View previous topic :: View next topic
|
Author |
Message |
kayelan Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 13 Location: frankfurt
|
|
|
|
Hi,
I have two steps in JCL. In first step, the program creates a dynamically allocated output file and the second step has to take that dynamically allocated file in the previous step as input. How to extract the dataset name of the dynamically allocated file. Also I've seen in JESYSMSG of the joblog, we could get the dataset name of dynamically allocated file. But in JCL how to extract it and use it for second step?
Please see the example
//JOBEXTR <JOBPARM>
//STEP1 EXEC PGM1
//*****SYS061 IS DYNAMICALLY ALLOCATED OUTPUT FILE OF PGM1
//*****LET'S SAY DSNAME OF SYS061 = NOS.SYS061.STEP2.OUTPUT
//*
//STEP2 EXEC PGM2
//SYS010 DD DSN=NOS.SYS061.STEP2.OUTPUT,DIPS=SHR
//*****SYS010 IS THE INPUT OF PGM2 WHICH IS THE OUTPUT OF PREV. STEP
ALSO JESYSMSG of the job JOBEXTR:
IGD101I SMS ALLOCATED TO DDNAME (SYS061 )
DSN (NOS.SYS061.STEP2.OUTPUT )
STORCLAS (SCPROD) MGMTCLAS (M06MDWN) DATACLAS ( )
VOL SER NOS= PR0317
Since both the steps lie in the same job and JESYSMSG is shared by both, how to extract the DSNAME of SYS061 and use it in second step?
Or any other way to find this? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why is the dataset being dynamically allocated when it needs to be referenced later within the same job. What is the logic behind this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'm with expat, but if you must do something like this, you could modify the code that dynamically creates the dataset to also write the dataset name into a new PS output file (preferable a jcl statement that would look like "//ddname DD DSN=dynamic.dsn,"). The next step, read the PS file with the dynamically created dataset name DD and write a job thru the internal reader with the "dynamic" dsn in the submitted jcl. This submitted job would be the original "second" step.
This "submitter" could be an IEBGENER or SORT that would copy 3 concatenated jcl files to the internal reader:
File1 - JOB statement and any jcl up to the "dsn" DD statement
File2 - The "dsn" DD statement
File3 - The remainder of the jcl for the submitted job
And now the "second" step will run with the "dynamic dsn". |
|
Back to top |
|
|
|