Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Override all symbolics from JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Override all symbolics from JCL
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 2:22 pm    Post subject:
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    Post subject: sorry for that
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 2:41 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 3:17 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Jul 15, 2009 4:24 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 4:53 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 5:16 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm
No new posts Symbolic OverRide within a 'Include' ... Sysaron JCL & VSAM 7 Thu Aug 27, 2015 10:51 pm
No new posts Help in File Tailoring services ( Ove... thesumitk TSO/ISPF 8 Wed Jun 17, 2015 12:04 pm
No new posts Override Condition code richards12388 JCL & VSAM 3 Sat May 16, 2015 9:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us