how to set default value for any symbolic parameter.

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
mp3
Member
Posts: 2
Joined: Wed May 23, 2012 9:02 pm
Location: India

how to set default value for any symbolic parameter.

Post by mp3 » Wed May 23, 2012 9:18 pm

Hi,

Can anyone help me to resolve the following issue.
"How to set a default value for a symbolic parameter ?"

The JCL is something like this:

-------------------
// .. JOB ....
//* here i have to give some value to file name before running this JCL
// set filename=
//step1 exec PGM1,...........
//...........
//FILE1 dd dsn=abcd.zyxw..&filename, ............
//................
//..................
----------------------

Now the case is , if before running this JCl if I am setting some value for filename, then FILE1 will refer to that dataset.
But if filename is blank then , I want a default value DDDDD to be set to it.

How to achieve this.. :?:
--There is no limit to learning

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed May 23, 2012 9:49 pm

have your job steps either in an inline PROC or a member of a proc library.

in the proc, set your default value.

in the job, either comment out the symbolic or put in a filename.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed May 23, 2012 10:58 pm

in the proc, set your default value.
This goes on the PROC statement:

Code: Select all

//RUNPGM1  PROC &FILNAM=DDDDD
and your DD could be:

Code: Select all

//FILE1 DD DSN=abcd.zyxw..&filename, ............ 
with a:

Code: Select all

           PEND
after the last DD statement

To execute this proc using the default:

Code: Select all

//DOIT     EXEC RUNPGM1,FILNAM=
To execute this proc using a runtime value:

Code: Select all

//DOIT     EXEC RUNPGM1,FILNAM=thevalue
Have a good one

mp3
Member
Posts: 2
Joined: Wed May 23, 2012 9:02 pm
Location: India

Post by mp3 » Thu May 24, 2012 7:08 am

Thanks dbzTHEdinosauer and DikDude for explaining.

But i was actually looking for an option in JCL where we can handle this case when the filename is not given instead of commenting it out is there any other option.

Because when this JCL moves to production, I want the JCL itself to handle this scanerio instead of asking them to either give the filename or give the default value or comment it out. That's why am looking for any way JCL itself can handle it.

I know IF/ELSE will not work here, but theoritically I am looking for something like this

// If filename=' ' then
//want to set filename=DDDD here
// else
// filename=&filename.


Is there a way to achieve this objective. :?:
--There is no limit to learning

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Thu May 24, 2012 8:35 am

Either i'm confused or you are . . .

How would filename be changed from one run to the next? "Someone" has to change something unless i am missing something :?
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Thu May 24, 2012 11:20 am

In a production environment everything in your JCL should stay static - including filenames. If you need to override a name on a once-off then an override should be provided, properly signed off, and the appropriate person will put the one-off change into the run deck for that one run.
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others