IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to extract DSNAME of the dynamically allocated file ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kayelan
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 13
Location: frankfurt

PostPosted: Sat Mar 24, 2007 12:45 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Mar 24, 2007 5:09 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Mar 25, 2007 4:54 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top