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 create a JCL where DD name is a variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to create a JCL where DD name is a variable
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

Moderator Team Head


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

PostPosted: Tue Mar 17, 2009 9:11 pm    Post subject: Reply to: Variable DD name
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    Post subject: INCLUDE statment is member of PDS, in my case the Dataset na
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    Post subject:
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    Post subject: you want the DSN to be variable
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Mar 17, 2009 10:54 pm    Post subject: Reply to: Variable DD name
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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