Hi All,
I tried to create an object dynamically using USR2014N, and able to write in the SWA using USR2019N and able to save that object. When i tried to stow the object using USR0210N, the return code is 0(ERR is 0) , still object doesnt get stowed.
While going thru the documentation, I found the below explanation.
---
Once the subprogram(USR0210N)has returned to the calling program
with ERR=0, the NATURAL STACK will have been modified.
The caller has to issue a STOP statement to give control
to the STACK mechanism.
.
On the STACK, there are now commands that start the wanted function.
.
A Natural module will be catalogued or stowed via the Natural stack,
because it is not possible to call the Natural compiler from a Natural
module. With USR1052N (Send a command to the operating system) a user
may start a batch Natural and catalog an object in a separate Natural
batch session.
---
1. Natural module cannot be cataloged/Stowed using a module?
2. I want to stow the saved object using a module. Is there any other way to do that?
Note: I am calling these three subprograms in a single program one after the other.
Cheers
Arkantos
Natural API USR0201N
Re: Natural API USR0201N
Hi Anbu
I need to know what actions (passed parameters) you are taking after calling USER0210N. I assume you're passing something similar to this:
I used the above details and was able to STOW the code in SWA (currently USR0210P) into my-library as TEST07. Attached are the before/after screen captures.
Regards,
Ats
I need to know what actions (passed parameters) you are taking after calling USER0210N. I assume you're passing something similar to this:
Code: Select all
Save, cat, stow NATURAL source:
-------------------------------
Action .................... STOW__
Name of source ............ TEST07
Library ................... my-lib
Read source into editor ... N
Type of source ............ P
Press any PF-key to stop.,
I used the above details and was able to STOW the code in SWA (currently USR0210P) into my-library as TEST07. Attached are the before/after screen captures.
Regards,
Ats
You do not have the required permissions to view the files attached to this post.
- RGZbrog
- Posts: 101
- Joined: Mon Nov 23, 2009 1:34 pm
- Skillset: Natural, Adabas, Predict, Natural Security, Construct, EntireX, SPoD, NaturalONE
- Referer: SAG Developer Forum
- Location: California, USA
- Contact:
Re: Natural API USR0201N
1. Natural module cannot be cataloged/Stowed using a module?
The documentation does not lie. You certainly are not the first to be frustrated by this.
2. I want to stow the saved object using a module. Is there any other way to do that?
Use the API to save the source, then either stack a CAT command or submit a batch job via NATRJE. Both these methods are asynchronous, so if you need to guarantee the result, you'll have to test for success. With Entire System Server you can check the return code of the job. With vanilla Natural you can see whether the object exists in the target library and check the time stamp (via API).
If you are very careful (and with a bit of luck), you may be able to stack your utility program after the CAT. If you stack enough control data, you may be able to pick up where you left off when you executed the STOP statement.
Re: Natural API USR0201N
I checked (as it was my attempt to STOW from SWA) on CAT with already saved but not cataloged object. The API USR0210N did work perfect for me. Hence I dare to say:
No, it can be with the API USR0210N
Use the API USR0210N
I hope, I have taken it correctly
Regards,
Ats
1. Natural module cannot be cataloged/Stowed using a module?
No, it can be with the API USR0210N
2. I want to stow the saved object using a module. Is there any other way to do that?
Use the API USR0210N
I hope, I have taken it correctly

Regards,
Ats
- RGZbrog
- Posts: 101
- Joined: Mon Nov 23, 2009 1:34 pm
- Skillset: Natural, Adabas, Predict, Natural Security, Construct, EntireX, SPoD, NaturalONE
- Referer: SAG Developer Forum
- Location: California, USA
- Contact:
Re: Natural API USR0201N
Ats,
Arkantos wants to stay within his utility program as he makes multiple calls to USR0210N. This is not possible. Take a closer look at USR0210P, at the end of the module.
For the CAT and STOW to complete, you must return to the command prompt.
To simulate what Arkantos wants to do, change the STOP statement to IGNORE. Execute USR0210P and make several requests. Without leaving USR0210P, check the results with another mainframe session. You will see that the CATs and STOWs do not take place until you exit USR0210P.
Arkantos wants to stay within his utility program as he makes multiple calls to USR0210N. This is not possible. Take a closer look at USR0210P, at the end of the module.
Code: Select all
/* STACK has been modified. Execute the commands:
STOP
For the CAT and STOW to complete, you must return to the command prompt.
To simulate what Arkantos wants to do, change the STOP statement to IGNORE. Execute USR0210P and make several requests. Without leaving USR0210P, check the results with another mainframe session. You will see that the CATs and STOWs do not take place until you exit USR0210P.
Re: Natural API USR0201N
Agreed Ralph,
My point was it is possible using modules!
Regards,
Ats
My point was it is possible using modules!
Regards,
Ats
Re: Natural API USR0201N
Ralph,
Exactly thats what i was doing(removed STOP statement) and it was not stowing. So I issued a Stop command and it is stowing perfectly.
Thanks a ton Ralph and Ats.
Cheers
Arkantos
Exactly thats what i was doing(removed STOP statement) and it was not stowing. So I issued a Stop command and it is stowing perfectly.
Thanks a ton Ralph and Ats.
Cheers
Arkantos