NATRJE for Windows?

On the mainframe, we submit jobs by using the NATJRE function.
We have self-written software to migrate JCL to VBS.
What is the equivalence to NATRJE for Natural on Windows?
Do you have examples?

Dieter Storr

Hello Dieter,

maybe ‘winbatch’ can help you.

Use USR1052N for sending a command to the Operting system.

Call an own written winbatch.exe (which starts natural in background mode (Command is ‘RunHide’).

see more

hope it helps


Hi Dieter,
I would go for the standard “SHCMD” command

There are examples in the documentation
See: “Issuing Operating System Commands from within a Natural Program” like below…

This approach uses a different “paradigm” than NATRJE, because you can only issue one command and not a full JCL.
So usually you create a temporary .CMD file and then “submit” this either synchronous or asynchronous.

RESET rc (I4)
rc = RET( ‘SHCMD’ ) /* retrieve return code
IF rc <> 0 THEN /* in case of an error
DISPLAY “Error occurred during SHCMD” /* display an error message

Thank you for your examples and very helpful tips.

Very simplified, our program looks like this:

Read JCL or VBS from an Adabas file

if *machine-class ne ‘MAINFRAME’
perform process-script …

#JCL-MEMBER := line_of_code
compress ‘\cst87\cst87-w\batchjob\batchsubmit’ #jcl-member ‘.vbs’
into #exe-file leaving no
compress 'CMD.EXE /C dir ’ #work-file into os-command

And here is some background info of our applications:

Our JCL is saved in one Adabas file and in a PDS dataset. We will need both because the Natural program can start on the mainframe and/or Windows.

A) First possible way to change JCL:

  • Read JCL from the Adabas file and save it as a text file
  • Translate the JCL into VB script by using a software
  • Problem with the software: it doesn’t migrate OS
    Sort statements.
  • Save the migrated code (JCL to VBS) into an Adabas file

B) Second possible way to change JCL:

  • Same as A but save it as .vbs on windows

Any recommendations are very helpful.

By the way, Happy Holidays, Merry Chistmas, Happy Hannukah, etc.

Thank you so much.
Dieter Storr