Insert statements in current Workarea

Is there a way to insert a few statements after/before a label in Natural Editor? To be more clear, entering some usercommands/MACROS similar to SAVE, STOW, etc., can we insert a few standard/userdefined statements into the NATURAL’s current workarea.

Thanks. Selva

It depends on the editor you use.

In Natural Studio (SPoD) user exit (now called API) USR6004N can read, update and delete lines in the current source window. Used together with USR6005N you can control the part of the window where the cursor is, or the lines selected with the mouse.

In Natural ISPF you can use USR2014N to write source lines into a source buffer. Further, ISP-U008 can be used to detect the current session number (buffer) in the ISPF editor.

When you first get the grasp of those API’s, the possibilities are wide. Enjoy.

Selva Kannan asked:

Is there a way to insert a few statements after/before a label in Natural Editor? To be more clear, entering some usercommands/MACROS similar to SAVE, STOW, etc., can we insert a few standard/userdefined statements into the NATURAL’s current workarea.

I am not sure if I am interpreting your question correctly, but it sounds as if you want to save an object with the code/statements to be inserted. Then, on the appropriate line you merely do .i(progname).

With the direction identifier as + or -, you can insert the code before or after the line. Is this what you want to do?

steve