Note: By mistake, I’ve edited this post instead of answering it. So I try to post here my initial question again. :oops:
Hello all!
I want do display additional ADABAS-Information in case of a runtime error. So I’ve included USR2010N to my Natural ON ERROR routine. But it doesn’t deliver the wanted information. The return values of USR2010N are always empty! Here’s my test code (a slightly changed USR2010P):
/* This is an example to call interface USR2010N.
/* It returns additional information about the most recent
/* database error that had occurred in the current session.
/**********************************************************************
DEFINE DATA LOCAL
01 DB_ERR_STR (A16)
01 REDEFINE DB_ERR_STR
02 DB_STATUS (A1)
02 DB_TYPE (A1)
02 DB_DBID (B2)
02 DB_FNR (B2)
02 DB_COMMAND (A2)
02 DB_RESP (B2)
02 DB_SUBCODE (B2)
02 DB_ADD1F2B (B2)
*
01 viewname view of ddm-name
02 ab
*
END-DEFINE
/*
get viewname 999999999 /* doesn't exist
on error
/*
CALLNAT 'USR2010N' DB_ERR_STR
/*
DISPLAY
'Status (A1)' DB_STATUS
'Type (A1)' DB_TYPE
'DBID (B2)' DB_DBID
'FNR (B2)' DB_FNR
'Cmd (A2)' DB_COMMAND
'Resp (B2)' DB_RESP
'Subcd (B2)' DB_SUBCODE
'Add (B2)' DB_ADD1F2B
/*
stop
end-error
END