passing value from one step to another



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

passing value from one step to another

Postby senthil1983 » Mon Aug 17, 2015 10:11 am

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
senthil1983
 
Posts: 3
Joined: Sun Mar 24, 2013 6:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing value from one step to another

 

Re: passing value from one step to another

Postby Robert Sample » Mon Aug 17, 2015 11:14 am

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: passing value from one step to another

Postby BillyBoyo » Mon Aug 17, 2015 11:26 am

How about output second step to a fixed name and rename or copy it, generating the control cards to do so.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: passing value from one step to another

Postby senthil1983 » Mon Aug 17, 2015 11:32 am

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
senthil1983
 
Posts: 3
Joined: Sun Mar 24, 2013 6:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing value from one step to another

Postby prino » Mon Aug 17, 2015 12:33 pm

Use dynamic allocation in the step 2 pgm. Both COBOL and PL/I can do it.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: passing value from one step to another

Postby hailashwin » Mon Aug 17, 2015 12:38 pm

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.
hailashwin
 
Posts: 5
Joined: Wed Jan 05, 2011 5:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing value from one step to another

Postby DonkeyKong » Wed Sep 23, 2015 7:48 pm

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                       
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post