Reputation: 998
We have a REXX program which creates a dataset LOG.DYYMMDD.THHMMSS.OUT saves in DDNAME LOGNM.
We call the REXX PROGRAM from JCL using IKJEFT1B utility.
How do I use this dataset for further processing in JCL. I mean how I refer it in the JCL since the dataset name is dynamically created.
Upvotes: 0
Views: 2296
Reputation: 13076
Once your dataset is created, you can refer to it in JCL exactly as you would any other dataset. It does not matter that it was created dynamically, as the dataset disposition is included when you create it. It gets processed exactly as though it were created with a JCL DD statement. I'm not aware that there is even an indication that it was created dynamically, once it has been created. It is no different from any other PS dataset.
If cataloged:
//SOMENAME DD DISP=SHR,DSN=LOG.DYYMMDD.THHMMSS.OUT
If not cataloged, catalog it, then see above.
If deleted when closed, don't delete it but catalog it, then see above.
Note: I have assumed that you are creating your dataset in one JOB and accessing it in others. If you are accessing it in the same JOB, take good note of Bruce Martin's answer. Your dataset will be "hidden", from the normal assessment of Disposition processing of the JOB when it is submitted because the dataset is only created after that point, when the JOB is actually running (if it gets as fair as running, it may fail immediately with a "JCL ERROR" without even getting close to running).
Personally I'd do it in separate JOBs, but some people think they are keeping things simple when they are not.
Upvotes: 1
Reputation: 10543
Are you creating the dataset in the Rexx program using TSO Allocate or TSO Copy command or similar TSO commands ???
//LOGNM DD DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=(NEW,CATLG), ....
//LOGNM DD DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=(NEW,CATLG), ....
or
//LOGNM DD DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=OLD
you should have no problem using the Dataset in following steps.
//LOGNM DD DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=(NEW,DELETE), ....
then change the DELETE to CATLG (or pass)
Upvotes: 2