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 Replace DD Name?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Mon Nov 02, 2009 2:17 pm    Post subject: How to Replace DD Name?
Reply with quote

Hi All,

Is there any way to override a specific DDNAME in PROC from a JCL?

P.M
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: Mon Nov 02, 2009 2:36 pm    Post subject:
Reply with quote

Yes, click the button marked "IBM Manuals" at the top of any page, and go read the JCL reference manual.
Back to top
View user's profile Send private message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Mon Nov 02, 2009 2:44 pm    Post subject: Reply to: How to Replace DD Name?
Reply with quote

Suppose my Proc is like:
//PROC

//STEP1 EXEC PGM=PGM1

//DD1 DD DSN=FILE1

If Want to override file1 with file2 then in my JCL I will write as:
//STEP1.DD1 DD DSN=FILE2

But suppose I want to override DD1 with DD2.

Then how we can override DD1 with DD2 from a JCL?
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: Mon Nov 02, 2009 2:53 pm    Post subject:
Reply with quote

What exactly are you on about .................

You want to remove DD1 and insert DD2 ? Why ?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Nov 02, 2009 2:55 pm    Post subject:
Reply with quote

That's not overriding, by definition. When you want to override "DD1" with "DD2" -- what difference would that make to the JCL execution unless you change the DSN associated with that DD? Do you change the program executed in 'that-step" to include "DD2"(I assume COBOL program), if so, you should permanently change the JCL to use DD2 instead of using overrides.
Back to top
View user's profile Send private message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Mon Nov 02, 2009 3:10 pm    Post subject: Reply to: How to Replace DD Name?
Reply with quote

This is Just for my knowledge. Is there any way?
I guess one way to replace DD1 with DD2 is
Make DD1 as dummy from JCL
Add DD2 in JCL
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: Mon Nov 02, 2009 3:29 pm    Post subject:
Reply with quote

Correct, but as the program will open the DD names assigned within, it will not open DD2 and expect DD1
Back to top
View user's profile Send private message
Permander Malik

New User


Joined: 24 Oct 2009
Posts: 11
Location: Mumbai

PostPosted: Mon Nov 02, 2009 3:31 pm    Post subject: Reply to: How to Replace DD Name?
Reply with quote

That's True.
Thank You
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Nov 02, 2009 6:32 pm    Post subject:
Reply with quote

Actually, you MIGHT try specifying

//STEP1.DD1 DD DDNAME=DD2

then adding

//STEP1.DD2 DD DSN=yadayadayada,etc.

This, in essence, tells the OS that any reference to DD1 should be redirected to DD2

Note: I know that this redirection works in runjcl ( especially to concatenate SYSIN statements with other files ), but do not know for certain, that it will work for overriding a PROC.
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: Mon Nov 02, 2009 6:47 pm    Post subject:
Reply with quote

A nice way around it, one that I had completely forgotten about, but it will depend on where the DD ststements are in relation to each other. I knew that there was sone limitation to using this method so thought I'd test it out.

The example below will work as the 'Option' DD names follow the DD name affected
Code:

//MYPROC   PROC SYSIN=SYSIN1               
//STEP0020 EXEC PGM=IDCAMS                 
//SYSPRINT DD SYSOUT=*                     
//SYSIN    DD DDNAME=&SYSIN                 
//SYSIN1   DD DSN=AA.JCL(Member3),DISP=SHR
//SYSIN2   DD DSN=AA.JCL(Member4),DISP=SHR
//MYPROC   PEND                             
//*                                         
//MYPROC   EXEC MYPROC,SYSIN=SYSIN2         

However, the code below does not work
Code:

//MYPROC   PROC SYSIN=SYSIN1               
//STEP0020 EXEC PGM=IDCAMS                 
//SYSPRINT DD SYSOUT=*                     
//SYSIN1   DD DSN=AA.JCL(Member3),DISP=SHR
//SYSIN2   DD DSN=AA.JCL(Member4),DISP=SHR
//SYSIN    DD DDNAME=&SYSIN                 
//MYPROC   PEND                             
//*                                         
//MYPROC   EXEC MYPROC,SYSIN=SYSIN2         
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Nov 02, 2009 7:00 pm    Post subject:
Reply with quote

Correct, according to the JCL Reference Manual:

Place a DD statement containing a DDNAME parameter in a job step or in a cataloged or in-stream procedure. The referenced DD statement must be later in the same job step, must be in the calling job step, or must be in a cataloged or in-stream procedure called by the job step.
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 Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm
No new posts DFSORT - FIND AND REPLACE Other Field... Arunraj Murugaiyan DFSORT/ICETOOL 6 Fri Feb 12, 2016 1:52 pm


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