# USR2010N doesn't work as I expect ...

**URL:** <https://techcommunity.softwareag.com/t/usr2010n-doesnt-work-as-i-expect/60770>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [April 4, 2006, 6:53pm UTC](https://techcommunity.softwareag.com/t/usr2010n-doesnt-work-as-i-expect/60770 "2006-04-04T18:53:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [April 4, 2006, 6:53pm UTC](https://techcommunity.softwareag.com/t/usr2010n-doesnt-work-as-i-expect/60770/1 "2006-04-04T18:53:16Z")

</div>

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):

```auto
/* 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
```

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [April 5, 2006, 1:05pm UTC](https://techcommunity.softwareag.com/t/usr2010n-doesnt-work-as-i-expect/60770/2 "2006-04-05T13:05:37Z")

</div>

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

```auto

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)?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/usr2010n-doesnt-work-as-i-expect/60770/3 "2021-04-02T14:40:33Z")

</div>


