View previous topic :: View next topic
|
Author |
Message |
revathi palaniswamy
New User
Joined: 16 May 2011 Posts: 4 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
revathi palaniswamy
New User
Joined: 16 May 2011 Posts: 4 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
revathi palaniswamy
New User
Joined: 16 May 2011 Posts: 4 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
revathi palaniswamy
New User
Joined: 16 May 2011 Posts: 4 Location: India
|
|
|
|
Thank you so much |
|
Back to top |
|
|
|