Work filename as input parameter

In some batch program I’m using:
READ WORK FILE 1 DATA

In a job that is runned i need to define CMWKF01 as work file, for example BAR.WORKS.TEST1.

Is possible to get work name (BAR.WORKS.TEST1) as input parameter to Natural program ?

If you have Entire System Server, you could read the workfile directly using the dataset name which could be held in a variable.

Or… you could dynamically write JCL with Natural and submit it to RJE via NATRJE or PROCESS SUBMIT.

Hi Artur,

Take a look at the DEFINE WORK FILE statement.

e.g.

INPUT #DSN
DEFINE WORK FILE 1 #DSN

N.B. The dataset must be catalogued and is allocated with DISP=SHR.


Graeme Lane

Hi Artur,

On further reading of your question, it could also be interpreted as you wanting to be able to find out the name of the dataset as defined in the JCL. You can use USR1050N or USR2011N to do that.

Cheers,

Graeme Lane

If you need to dynamically define CMWKF01 to point to BAR.WORKS.TEST1 use
USR2021N in library SYSEXT.

Not quite sure I understand, you can supply it as a parameter via CMPRMIN, then use INPUT
from your Natural program to read it in, if this doesn’t answer the question please clarify.

Thanks a lot for Your help.