Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to extract DSNAME of the dynamically allocated file ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to extract DSNAME of the dynamically allocated file ?
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: 8593
Location: Back in jolly old England

PostPosted: Sat Mar 24, 2007 5:09 pm    Post subject:
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

Site Director


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

PostPosted: Sun Mar 25, 2007 4:54 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us