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
 

 

JCL - Override parameter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL - Override parameter
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon May 16, 2011 1:29 pm    Post subject: Reply to: JCL - Override parameter
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon May 16, 2011 1:52 pm    Post subject: Reply to: JCL - Override parameter
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon May 16, 2011 2:30 pm    Post subject: Reply to: JCL - Override parameter
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: 8593
Location: Back in jolly old England

PostPosted: Mon May 16, 2011 2:37 pm    Post subject:
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: 1715
Location: UK

PostPosted: Mon May 16, 2011 11:26 pm    Post subject:
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

Site Director


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

PostPosted: Tue May 17, 2011 2:28 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue May 17, 2011 2:47 am    Post subject: Reply to: JCL - Override parameter
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    Post subject: Reply to: JCL - Override parameter
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    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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 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 Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm


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