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

JCL - Override parameter


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

New User


Joined: 16 May 2011
Posts: 4
Location: India

PostPosted: Mon May 16, 2011 1:18 pm
Reply with quote

Hi,

I have an requirement in which i need to set a symbolic parameter in the JCL based on the requirement in each run;Depends on the value passed to the symbolic para the input filebeing used in the jcl also vary.

clearly say,The symbolic parameter passed in the JCL is 'V'.
if V='|M|' --> then input file used in the proc is : GD.OC33&V.&F..&P.0.DC01
if V='|A|' --> then input file used in the proc is : GD.OC33&V.&F..&P.0.DC01 And GD.OC556R.P028.M01.DC95

Question : I need to code both files in the procedure irrespective of the parameter passed, and while submitting the jcl,it should take correct input file based on value specified in V.
Please some one help me on this.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 1:29 pm
Reply with quote

review Your understanding of jcl parameter substitution ...
a parameter is substituted asis

in Your example
Quote:
if V='|M|' --> then input file used in the proc is : GD.OC33&V.&F..&P.0.DC01

the output as processed by jcl parameter substitution will be just
GD.OC33M.&F..&P.0.DC01
same for any value used for V
the other &<things> will be substituted in the same way.
jcl is not a scriptable language

the only way out is to perform full DD override
Back to top
View user's profile Send private message
revathi palaniswamy

New User


Joined: 16 May 2011
Posts: 4
Location: India

PostPosted: Mon May 16, 2011 1:38 pm
Reply with quote

Thanks for your quick reply.

The substitution is fine to me(Overriding concept). But the question is, if i use V=|M| it should take only one file as input , at the same time if V=|A| it should take two files as input. I have to code the logic for the same.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 1:52 pm
Reply with quote

that the principle behind jcl parameter handling logic
it will not add nor delete anything,
it will just handle what is there, no more no less


as i said before, but You did not care to consider it
use DD override

for the case M
Code:
//GO      EXEC <yourproc>,<Your parameters>


for the case A
Code:
//GO      EXEC <yourproc>,<Your parameters>
//<stepname><ddname DD
//          DD DISP=SHR,GD.OC556R.P028.M01.DC95


tested and working
Back to top
View user's profile Send private message
revathi palaniswamy

New User


Joined: 16 May 2011
Posts: 4
Location: India

PostPosted: Mon May 16, 2011 2:06 pm
Reply with quote

Thanks.

In the above sample code, we are overriding (adding) additional file in the JCL (job) in case of V=A. This is one way to handle right.

Is there any other way to add all the input file names in the procedures, and pass V=M or A from JCL and depends on the value Proc should take correct file to process.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 2:30 pm
Reply with quote

since the solution I posted works why in heaven You keep pestering for different ones ?

replying on a forum is
on voluntary base
on our own time
free of charge
usually based on above average experience
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon May 16, 2011 2:37 pm
Reply with quote

I can very vaguely remember doing something similar about 20+ years ago.

As I don't have mainframe access for this contract the concept is derived from memory and the order of the DD statements may be the wrong way around.

Everything that you need to know is readily available in the JCL manuals.

Take a look at
Code:

//A        DD DSN=dsn1,DISP=SHR
//B        DD DSN=dsn1,DISP=SHR
//         DD dsn=dsn2,DISP=SHR
//ddname   DD DDNAME=&V.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon May 16, 2011 11:26 pm
Reply with quote

You could use your symbolics to pick up seperate INCLUDE code - when M it picks up INCLUDE code with one dataset when A it will pick up the INCLUDE code for the concatenated datasets.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 17, 2011 2:28 am
Reply with quote

Hello,

Just make sure both files exist (or are created before reaching this step). Otherwise there will be a "file not found" JCL error.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 17, 2011 2:47 am
Reply with quote

icon_redface.gif I had forgotten that // include can be parametrized
tested and working ...

everything is in ENRICO.TEST.JCL
the job
Code:

EDIT       ENRICO.TEST.JCL(ZJOB) - 01.05                   Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //ENRICO1  JOB NOTIFY=&SYSUID,
000002 //             REGION=0M,
000003 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
000004 // JCLLIB ORDER=(&SYSUID..TEST.JCL)
000005 //*
000006 //GO      EXEC ZPROC,V='M'
000005 //*
000006 //GO      EXEC ZPROC,V='A'
****** **************************** Bottom of Data ****************************


the proc
Code:

EDIT       ENRICO.TEST.JCL(ZPROC) - 01.05                  Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 // INCLUDE MEMBER=ZSTUB&V
****** **************************** Bottom of Data ****************************


stub for v='A'
Code:

EDIT       ENRICO.TEST.JCL(ZSTUBA) - 01.02                 Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //IEF     EXEC PGM=IEFBR14
000002 //SYSPRINT  DD SYSOUT=*
000003 //SYSUT1    DD DISP=SHR,DSN=ENRICO.TEST.PSFB&V
000004 //          DD DISP=SHR,DSN=ENRICO.TEST.PSFB
****** **************************** Bottom of Data ****************************



stub for v='M'
Code:

EDIT       ENRICO.TEST.JCL(ZSTUBM) - 01.02                 Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //IEF     EXEC PGM=IEFBR14
000002 //SYSPRINT  DD SYSOUT=*
000003 //SYSUT1    DD DISP=SHR,DSN=ENRICO.TEST.PSFB&V
****** **************************** Bottom of Data ****************************


it works, but I feel that a DD override might be less cumbersome
Back to top
View user's profile Send private message
revathi palaniswamy

New User


Joined: 16 May 2011
Posts: 4
Location: India

PostPosted: Tue May 17, 2011 2:47 pm
Reply with quote

Thank you so much icon_smile.gif
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 Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top