How to pass parameters to Jcl?



IBM's Command List programming language & Restructured Extended Executor

How to pass parameters to Jcl?

Postby SKANDA » Sat Dec 24, 2016 7:58 am

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
SKANDA
 
Posts: 30
Joined: Thu Aug 04, 2016 7:50 pm
Has thanked: 17 times
Been thanked: 0 time

Re: How to pass parameters to Jcl?

Postby steve-myers » Sat Dec 24, 2016 9:26 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: How to pass parameters to Jcl?

Postby NicC » Sat Dec 24, 2016 3:37 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post