# ON ERROR - Debug

**URL:** <https://techcommunity.softwareag.com/t/on-error-debug/75966>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Utilities\
**Created:** [January 9, 2008, 5:24pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966 "2008-01-09T17:24:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PNSimoes](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@PNSimoes](https://techcommunity.softwareag.com/u/PNSimoes)\
**Post date:** [January 9, 2008, 5:24pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/1 "2008-01-09T17:24:07Z")

</div>

Hi,

I’m trying to debug a Program that contains a ON ERROR statement, but in debug mode when a error occurs the debug doesn’t go to the ON ERROR statement.

And i need to debug that part of the program.

PS: For Debug I’m doing the instruction **_“MOVE 6173 to \*ERROR-NR”_**

Can anyone help me? Or it’s a issue that should be posted at servline24?

---

<div class="post-metadata">

**Author:** ![Aldo\_Teusch](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/aldo_teusch/32/87_2.png) [@Aldo\_Teusch](https://techcommunity.softwareag.com/u/Aldo_Teusch)\
**Post date:** [January 9, 2008, 5:59pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/2 "2008-01-09T17:59:51Z")

</div>

Hi PNSimoes,

I tried it out with NAT414 on MF and it does work. What environment are you using in ?

Aldo

---

<div class="post-metadata">

**Author:** ![PNSimoes](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@PNSimoes](https://techcommunity.softwareag.com/u/PNSimoes)\
**Post date:** [January 9, 2008, 6:16pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/3 "2008-01-09T18:16:13Z")

</div>

Hi Aldo,

I’m using SPoD 6.3.2 on XP and Natural 4.2.3 on Mainframe Z/OS. And the debug that i’m doing is on the SPoD side.

---

<div class="post-metadata">

**Author:** ![Aldo\_Teusch](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/aldo_teusch/32/87_2.png) [@Aldo\_Teusch](https://techcommunity.softwareag.com/u/Aldo_Teusch)\
**Post date:** [January 9, 2008, 7:54pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/4 "2008-01-09T19:54:26Z")

</div>

Did you try PF11 instead of PF7 ? With NAT625 on WIN2000 and NAT414 on z/OS PF11 does the job whereas PF7 doesn’t.

Aldo

---

<div class="post-metadata">

**Author:** ![PNSimoes](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@PNSimoes](https://techcommunity.softwareag.com/u/PNSimoes)\
**Post date:** [January 9, 2008, 7:59pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/5 "2008-01-09T19:59:44Z")

</div>

Yes. And when I do the PF11 at MOVE statement, it gives me, imediatelly, the NAT6173 Error message instead of going to the ON ERROR statement.

---

<div class="post-metadata">

**Author:** ![Klaus\_Sponagel](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@Klaus\_Sponagel](https://techcommunity.softwareag.com/u/Klaus_Sponagel)\
**Post date:** [January 11, 2008, 5:01pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/6 "2008-01-11T17:01:49Z")

</div>

Hi PNSimones  
I run following program in SPoD Debugger of Natural Studio:  
:

```auto

MOVE 111 TO *ERROR-NR
ON ERROR
  WRITE 'error' *ERROR-NR 'OCCURED IN PGM' *PROGRAM
END-ERROR
END
```

After starting the program in debug mode it stops initially on line 0010. If I press PF11 te error window for NAT111 pops up. I click OK and press PF11 again and the debugger continues on line 0030 in ON ERROR.  
I tested with NDV223SP4 and Natural Studio V633

Can you test this in your environment if it behaves the same?

---

<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:49pm UTC](https://techcommunity.softwareag.com/t/on-error-debug/75966/7 "2021-04-02T14:49:03Z")

</div>


