View previous topic :: View next topic
|
Author |
Message |
Permander Malik
New User
Joined: 24 Oct 2009 Posts: 11 Location: Mumbai
|
|
|
|
Hi All,
Is there any way to override a specific DDNAME in PROC from a JCL?
P.M |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes, click the button marked "IBM Manuals" at the top of any page, and go read the JCL reference manual. |
|
Back to top |
|
|
Permander Malik
New User
Joined: 24 Oct 2009 Posts: 11 Location: Mumbai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What exactly are you on about .................
You want to remove DD1 and insert DD2 ? Why ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Permander Malik
New User
Joined: 24 Oct 2009 Posts: 11 Location: Mumbai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Correct, but as the program will open the DD names assigned within, it will not open DD2 and expect DD1 |
|
Back to top |
|
|
Permander Malik
New User
Joined: 24 Oct 2009 Posts: 11 Location: Mumbai
|
|
|
|
That's True.
Thank You |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
|
|