I am using USR0210N and when the object has no error, it works fine, however, when the object has any error, syntax for example, an error is intercepted by Natural, and the code doesnt remain the control, so, does anyone know how to remain having the control, in order to handle the error?
the ideia is to catalog (or stow) the object.
I tried to use it in batchmode, in order to read the cmprint - sysout in a second step - while we dont have the solution for the application gets the control of the error, but, I am receiving the error: NAT0001 and I cannot get out of this error.
does anyone know how to solve one or both problems?
Have you tried something like that?
callnat 'CAT-N' 'GOODPROG' 'MYLIB' #error-nr
callnat 'CAT-N' 'FAILPROG' 'MYLIB' #error-nr
And CAT-N is
#error-nr := *ERROR-NR
callnat 'USR0210N' ....
I have tried to use ON ERROR on both side (program and subprogram), *error-ta, and USR1041N + *error-ta. however, none of them solved the problem, Natural is still intercepting the message.
we need to remember that usr0210n needs to put the source code on work area and it seems that Natural takes the control after this.
any other suggestions…
Once we have program structure in the form of an array of command lines, it is time to make them into a program module. To do that, we will use three services by software’s
(1) USR2014N - interface for using the editor engine facility
(2) USR4201N - service to read and write data area sources and
(3) USR0210N - interface for issuing save, catalog and stow commands on source modules.