Page 1 of 1

passing value from one step to another

PostPosted: Mon Aug 17, 2015 10:11 am
by senthil1983
I have step1 where program execute and write file name in output file "ex - abc.xyz"
now i need to have file name from previous step output ass dd name in next step

step2...
//file dd dsn=abc.xyz,disp=shr

pls help

Re: passing value from one step to another

PostPosted: Mon Aug 17, 2015 11:14 am
by Robert Sample
If you are asking to dynamically define a data set name in step 1 and refer to it in step 2 of the same job - this cannot be done. You can submit another job to reference the data set.

Re: passing value from one step to another

PostPosted: Mon Aug 17, 2015 11:26 am
by BillyBoyo
How about output second step to a fixed name and rename or copy it, generating the control cards to do so.

Re: passing value from one step to another

PostPosted: Mon Aug 17, 2015 11:32 am
by senthil1983
Yes 2nd step is fixed..

Illustration : highlighted in bold and italic

//Step1 pgm..
//input dd dsn=inputfile,disp=shr
//output dd dsn=123.out,disp=shr ==> 123.out contains "abc.xyz"
//************************************************************************************
//step 2 pgm..
//input dd =abc.xyz,disp=shr
//output dd=outputfile,disp=shr

Re: passing value from one step to another

PostPosted: Mon Aug 17, 2015 12:33 pm
by prino
Use dynamic allocation in the step 2 pgm. Both COBOL and PL/I can do it.

Re: passing value from one step to another

PostPosted: Mon Aug 17, 2015 12:38 pm
by hailashwin
For a similar process, I read the file name from abc.xyz in step2- cobol program and use BPXWDYN to allocate and read the file.

Thanks,
Ashwin.

Re: passing value from one step to another

PostPosted: Wed Sep 23, 2015 7:48 pm
by DonkeyKong
If I understand you correctly, this is a very simple thing to do. I believe that you want to use symbolics. For example...

//SET FILENAME='THIS.IS.YOUR.ABC.XYZ.FILE'     
//S001 EXEC PGM=XXXXX                         
//INPUT  DD DSN=INPUTFILE,DISP=SHR             
//OUTPUT DD DSN=&FILENAME,DISP=SHR             
//          DISP=(,CATLG,DELETE),             
//          STORCLAS=SCPROD,                   
//          SPACE=(CYL,(177,2777),RLSE),       
//          DCB=DSORG=PS                       
//*********************************************
//S002 EXEC PGM=YYYYY                         
//INPUT  DD DSN=&FILENAME,                     
//          DISP=SHR                           
//OUTPUT DD DSN=OUTPUT.FILE,                   
//          DISP=(,CATLG,DELETE),             
//          STORCLAS=SCPROD,                   
//          SPACE=(CYL,(177,2777),RLSE),       
//          DCB=DSORG=PS