Page 1 of 1

How to pass parameters to Jcl?

PostPosted: Sat Dec 24, 2016 7:58 am
by SKANDA
Hi all,
Please help me to fix the following issue
FILEI DD DSN=DDD.REXX.TEST.PGM, DISP=SHR
In above DSN is it possible to pass member from rexx prog while executing.
If suppose DSN has 5members i want to pass those members one by one from rexx.

Thanks all,
Skanda

Re: How to pass parameters to Jcl?

PostPosted: Sat Dec 24, 2016 9:26 am
by steve-myers
You have two options.
  • In the TSO environment, execute a TSO command like ALLOC F(FILE1) REUS DATASET('DDD.REXX.TEST.PGM(MEMBER)') SHR
  • Use the BPXWDYN function to perform the previous allocation. I don't know if BPXWDYN accepts the REUSE keyword.

Re: How to pass parameters to Jcl?

PostPosted: Sat Dec 24, 2016 3:37 pm
by NicC
Your question is incomplete: "pass member from rexxprog" to where?
It almost sounds like you have a job and one of its steps is to execute a program, written in rexx (although the language is immaterial), said program to decide which data sets are to be used by later steps in the already executing job. If that is what you are meaning then the answer is that it is not possible - the JCL is processed at the time it is submitted and is then 'discarded'. When the job executes it is using what as been interpreted at job submission time.

What you can do is have your program run as a separate job and generate the later job with the data set names required. This can be done by the 'brute force' method of having the JCL coded within the program or by the better method of using the File Tailoring facilities of ISPF.

An alternative is to have your program write the datasets to a dataset which the following program(s) can read and then do dynamic allocations.