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

Override all symbolics from JCL


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

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jul 15, 2009 2:15 pm
Reply with quote

hi,

My JCL executes a single PROC many number of times. The PROC contains a symbolic variable, which would be overridden from JCL.

Can you please let me know if its possible to override the symbolic variable only once, so that the proc executing any step of the JCL contains that value?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 2:22 pm
Reply with quote

Your question is not entirely clear, please elaborate.
Back to top
View user's profile Send private message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jul 15, 2009 2:37 pm
Reply with quote

Please look at the example below

JCL:

//.....
//STEP1 EXEC PROC=PROC1,PARM1=TEST,PARM2=ABC
//......
//......
//STEP2 EXEC PROC=PROC1,PARM2=TEST,PARM2=DEF
//.....
//.....

As you see from the above example, I am executing the PROC PROC1 twice. The proc requires two parameters to run PARM1, PARM2. Only PARM2 changes for different steps but PARM1 remains the same any time I execute the proc in this JCL. (But it differs across different JCLs).

I want to know if there is way I can specify PARM1 value only at one place so that everytime I invoke the PROC it picks the value for PARM1 from that place.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 2:41 pm
Reply with quote

That depends on the way that the PROC is constructed.
Back to top
View user's profile Send private message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jul 15, 2009 3:06 pm
Reply with quote

I am using that variable to create a DDNAME

DD DSN=&PARM1..MYPDS.SECQUA,DISP=SHR
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 3:17 pm
Reply with quote

It all depends on how the PROC is constructed, what do you have coded on the internal PROC statement
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 15, 2009 4:24 pm
Reply with quote

huh? internal proc statement?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 4:53 pm
Reply with quote

Yeah, the bit that's inside the PROC. I know it's called the PROC statement, but when I was young it was always referred to as the internal, whilst the external was the actual EXEC card.

Old habits die hard
Back to top
View user's profile Send private message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jul 15, 2009 5:04 pm
Reply with quote

In the PROC statement i have coded the default values for the variable PARM1. But I want this to be overridden from JCL.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 5:16 pm
Reply with quote

If you had coded
Code:

//PROCNAME PROC
in the procedure, it would have been so much easier. You could have set the value in a SET statement and that would be it.

By having the default variables on the PROC statement you will need to change every occurrence of the EXEC statement.
Code:

// SET     PARM1='ABC'
//*
//PROC1    EXEC PROCNAME,PARM1=&PARM1.,PARM2=whatever1
//PROC2    EXEC PROCNAME,PARM1=&PARM1.,PARM2=whatever2
//PROC3    EXEC PROCNAME,PARM1=&PARM1.,PARM2=whatever3


Or to write the procedure correctly
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed Jul 15, 2009 5:48 pm
Reply with quote

Here's how symbolic replacement works;

1. A symbol is replaced by the value in the most recently seen SET statement
2. When a PROC is executed, the symbols defined in the PROC stament become active, the overridden symbols in the EXEC statement are applied which replace symbols from the PROC statement.
3. The PROC is processed and symbols are replaced. SET statements in the PROC may change symbols used in the PROC at this point.
4. If a symbol is in the PROC and isn't defined in the PROC statement, the symbol from the enclosing JOB/PROC is used.
5. This entire process is recursive upto the allowed 15 levels of nested PROCS
6. When a PROC end is reached, the symbols it defines or SET are removed

Actually, I haven't tested #6 for SET symbols in a PROC going back to the values before the PROC was called.
Back to top
View user's profile Send private message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jul 15, 2009 6:53 pm
Reply with quote

expat and mtaylor,

Thanks a lot for your help.
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 AN OVERRIDE MAY NOT TARGET OVERRIDING... JCL & VSAM 1
No new posts Compare Two datasets and Override Mat... DFSORT/ICETOOL 7
No new posts proc step return code to override in ... JCL & VSAM 3
No new posts IEHPROGM ENQUEUE OVERRIDE JCL & VSAM 4
No new posts Can DFSPARM override SORTKEYS paramet... DB2 2
Search our Forums:

Back to Top