thabrlo phungo
thabrlo phungo

Reputation: 11

Reading a parameter file and copy filenames to DSN

I want to know how you can copy from parameter file to a DSN name;

//S001     EXEC PGM=GL026D00,
//             PARM='GGGL150505'
//IPARM    DD  DSN=FCGL.BPYP667.CNTL(GGGLJ),
//             DISP=SHR               
//GGGLJ010 DD  DSN=FCGL.BPYP667.CNTL(%%Filename),   
//             DISP=SHR               
//SYSPRINT DD  SYSOUT=T 
//SYSDBOUT DD  SYSOUT=T 
//SYSABOUT DD  SYSOUT=T 

The IPARM will use a dataset with one record only, which will be one of the following names:

GGGLJ010

GGGLJ01I

GGGLJ01H

I want to replace %%filename with GGGLJ010 or GGGLJ01I or GGGLJ01H

Upvotes: 1

Views: 1551

Answers (1)

Bill Woodger
Bill Woodger

Reputation: 13076

Once a JOB is submitted and is ready for execution (it has completed the CONVERTER/INTERPRETER stage, see here if you are interested: http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.iata600/iat2n2_Converter_Interpreter_Service.htm) then the JCL is set in stone and cannot be changed.

One way to do what you want is with Dynamic Allocation from within your program.

Another, simpler, way to do it is to split your JOB and add a little extra as the first JOB and have the second submitted as held (TYPRUN=HOLD or however your Scheduler/Production Control people want it done) and which is then released, at which point it will pass through the CONVERTER/INTERPRETER.

In the first, new, separate, JOB, create file (can be a sequential file of RECFM F and LRECL 80) or a member of a PDS/PDSE with fixed-length records of 80 bytes.

In the second JOB, use the // INCLUDE JCL statement to put that file, with the formatted DSN you want, into that JCL stream.

I know which I'd prefer to do, but talk to your Scheduler/Production Control people to see how they'd prefer it to be done. Otherwise there's always a chance that they'll bounce your solution anyway, then you're back to square-one doing it how they want anyway. So cut out the middle-man (your potentially wasted attempt at it) and you'll look professional to those people as well, which will help :-)

There are several tools you can use to create your DD statement in the new file, SORT probably being the easiest.

Upvotes: 3

Related Questions