USR2010N doesn't work as I expect ...

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

Clumsy me! :oops: The code above creates the following output Code:


Status (A1) Type (A1) DBID (B2) FNR (B2) Cmd (A2) Resp (B2) Subcd (B2) Add (B2) 
----------- --------- --------- -------- -------- --------- ---------- -------- 
                                                                                
                      0000      0020     L1       0000      2020       2020     

:arrow: The DBID is H’0000’ because the regarding ddm contains the dbid “00”
:arrow: The FNR is space because the ddm points to file 32 which is “20” in hexadecimal

Does anyone know a USR-Program, which delivers more information (like the last *ISN)?