0

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.

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
Hara Chaitanya
  • 928
  • 3
  • 9
  • 17

2 Answers2

2

Are you creating the dataset in the Rexx program using TSO Allocate or TSO Copy command or similar TSO commands ???

  • If you are then you have a problem, you will not be able to reference the dataset saftely in following steps (There are methods that will work in some versions of JES). I would suggest you recode the rexx and allocate data set in the JCL.
       //LOGNM    DD  DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=(NEW,CATLG), ....
  • If you alread allocate the dataset using JCL i.e with a DD statement like
       //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.

  • If you allocate and delete the dataset using JCL i.e with a DD statement like
       //LOGNM    DD  DSN=LOG.DYYMMDD.THHMMSS.OUT,DISP=(NEW,DELETE), ....

then change the DELETE to CATLG (or pass)

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
  • Thanks, we are using TSO Allocate for the dataset . I found that we cannot refer the dataset allocated in REXX, so instead I redirected the name of the dataset in a file allocated in JCL to use further. – Hara Chaitanya Feb 19 '15 at 20:30
1

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.

Bill Woodger
  • 12,968
  • 4
  • 38
  • 47