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

How to create a JCL where DD name is a variable


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

New User


Joined: 28 Aug 2008
Posts: 8
Location: Wilson, NC

PostPosted: Tue Mar 17, 2009 9:09 pm
Reply with quote

Hi,

I am here with unusual situation.

How to create a JCL where DD name is a variable, I mean the dataset name changes from execution to execution.

Ex:

TEMP1 DD DSN=D555.AP.DDNAME, DISP=SHR

D555.AP.DDNAME will contain the dataset name to be processed.

Let me know if you need additional information.

Thanks,
Ram.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 17, 2009 9:11 pm
Reply with quote

Use an INCLUDE statement or a SET statement maybe?
Back to top
View user's profile Send private message
rdasari123

New User


Joined: 28 Aug 2008
Posts: 8
Location: Wilson, NC

PostPosted: Tue Mar 17, 2009 9:14 pm
Reply with quote

Thanks for prompt resp.

INCLUDE statment is member of PDS, it wont, work.

in my case the Dataset name is in a file, it gets update from on-line.

It means the file to be processed is passed to JCL from CICS.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Mar 17, 2009 9:17 pm
Reply with quote

Do you want the DD name as variable, the program processing the file would have to be able to handle a variable DD name, or do you want the DSN to be variable?
Back to top
View user's profile Send private message
rdasari123

New User


Joined: 28 Aug 2008
Posts: 8
Location: Wilson, NC

PostPosted: Tue Mar 17, 2009 9:26 pm
Reply with quote

Thanks for your resp.

I want "the DSN to be variable".

Ex:

Say the content of D555.AP.DDAME is "J555.AP.GDG.G01V0022"

in JCL

TEMP DD DSN=D555.AP.DDAME, DISP=SHR

Then TEMP should refer to J555.AP.GDG.G01V0022, in JCL.

Thanks again.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Mar 17, 2009 9:37 pm
Reply with quote

There is a big difference between a variable dd name and a variable dsn name.

Code:
//temp dd dsn=&temp1,disp=shr



Then when CICS submits the job just have include the variable in the job stream

Code:
//      set temp1=d555.ap.ddame
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Tue Mar 17, 2009 9:55 pm
Reply with quote

You could do something with SORT where a new JOB is created from static JCL statements and the dataset name in file D55.AP.DDNAME and then submitted to INTRDR.
Back to top
View user's profile Send private message
rdasari123

New User


Joined: 28 Aug 2008
Posts: 8
Location: Wilson, NC

PostPosted: Tue Mar 17, 2009 10:17 pm
Reply with quote

CICS is not going to submit the job, its going to update a dataset with data set name. The dataset has to be processed in JCL.


Craq Giegerich wrote:
There is a big difference between a variable dd name and a variable dsn name.

Code:
//temp dd dsn=&temp1,disp=shr



Then when CICS submits the job just have include the variable in the job stream

Code:
//      set temp1=d555.ap.ddame
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 17, 2009 10:54 pm
Reply with quote

Ram, I think you've been presented with all of the viable options. You'll have to use an INCLUDE and/or SET, programatically build and submit the JCL, or you'll have to use a program to read the content of 'D555.AP.DDAME' and use a dynamic allocation routine (i.e. BPXWDYN or TSO ALLOCATE) to process the imbedded dataset name.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top