JCL Tips.

A Mainframe-Tip a Day keeps the bugs away!
Forum rules
All of these Tips/Tuning-suggestions should be tested your own, at your shop, prior to use in Prod.
Post Reply
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

JCL Tips.

Post by Anuj Dhawan »

1. Using below refer-back one can execute a program from any other library:

Code: Select all

//STEP1 EXEC PGM=IEFBR14
//PROGRAM DD DSN=PROGRAM.LOADLIB(COBOLPGM),DISP=SHR
//STEP2 EXEC PGM=*.STEP1.PROGRAM
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

2. Shops are usually JES2 and JES3 , but is there any JES1 - Yes, OS/VS1 supported only one job entry subsystem namely JES1. Now you understand why it's called JES2... :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

3. &SYSUID is a "system symbol" for which the system substitutes your TSO ID. It is useful when more than one individual submits the same JCL.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: JCL Tips.

Post by Angel »

Always wanted to know why number starts from "2" in JES2/3, thanks for sharing Anuj.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

Glad, you find it helpful.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

4. A bit of history here about "NULL" statement in JCL. If you ever wondered why null statement was introduced in JCL?, Here is the answer -
Back when punched cards were used, a null coded on distinctive colored cards was used to help operators separate card decks and so it helped to identify the end-of-job card, and the start of next job for the operators.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

5. Let's consider this: I have a JCL with 15 steps. For some reasons a user wants to execute step 5 only. How to do it?

First method - You can use RESTART from STEP05, however, it will try to execute the subsequent steps too. To avoid that, we have to insert null statement after step05 to prevent the execution of subsequent steps.

Second method - in this we don’t need to edit the Job steps but we'd to alter the Jobcard. In JOBCARD we'd need to code COND parameter. That way, when the Job executes only the Step mentioned in the RESTART parameter will get executed. For example:

Code: Select all

 RESTART=STEP05,COND=(0,LE)
Third method - you can use IEBEDIT too.

Fourth Method - Using Labels.In this, mark the start of step/ with say, ".A" and the end of the step/s with ".B" and at command line write

Code: Select all

SUB .A .B
. However, this will impose a condition of 'how to include the Job card'. That I leave on the reader to explore... :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: JCL Tips.

Post by Anuj Dhawan »

6. Suggest, that programmers should always release (RLSE) unused SPACE (except for SAS datasets, MOD files and SORTWKs).

Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

JCL Tips.

Post by Anuj Dhawan »

7. JCL by its definition has the word 'language' in it but it's not a programming language, as such. Said that, JCL still has the ability to define variables. IBM and many user, usually, calls JCL variable as JCL symbols or symbolic parameters.

One can define a(n) JCL variable with SET DD card and will use it with an ampersand sign (&) in front of the variable later in the JCL. Where you use JCL variable, you can terminate it with a period (.) And you have to terminate with a dot, if you must have a dot right after the variable. For example:

Code: Select all

//Job card
//SET PREFIX = MY.ID 
//* 
//COMPRESS EXEC PGM = IEBCOPY 
//SYSUT1 DD DISP=SHR,DSN=&PREFIX.MY.PDS
//SYSUT2 DD DISP=SHR,DSN=&PREFIX.MY.PDS.BACKUP 
//SYSPRINT DD SYSOUT = * 
//SYSIN DD DUMMY
In "Test Jobs/JCLs" where the same text appears in several places, and must be replaced from time to time - such an option becomes handy.

There are at least two short-comings of this 'SET variable':
  • Unfortunately, a JCL variable can not be used in the SYSIN data. Though there are amendments to overcome this using REXX, but that's beyond the scope of this tip.
  • You can not use a JCL variable IF DD card.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
RyanFox
Registered Member
Posts: 52
Joined: Sat Jun 15, 2013 12:54 pm

Re: JCL Tips.

Post by RyanFox »

Excellent collection. Can we use them in real environment right away?
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

JCL Tips.

Post by Anuj Dhawan »

Probably yes, probably no. In this specific topic all the thing talked upon, so far, are of generic nature and does not really represent something as a tuning-tip (possibly RLSE can come under it, though) which will harm a production environment. I believe, when you are trying to use some 'tuning-tip' from here, you should experiment that at your test LPAR first and then if all is well, use it in PROD.

Hope this helps.

Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
RyanFox
Registered Member
Posts: 52
Joined: Sat Jun 15, 2013 12:54 pm

Re: JCL Tips.

Post by RyanFox »

Got your point, Thanks Anuj.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: JCL Tips.

Post by zprogrammer »

8. Identify JES2/JES3 messages

HASP => JES2 messages
IAT => JES3 messages

Manuals can be found here
http://publibz.boulder.ibm.com/cgi-bin/ ... CCONTENTS?
http://publibz.boulder.ibm.com/cgi-bin/ ... CCONTENTS?
zprogrammer
Quasar Chunawala
Registered Member
Posts: 34
Joined: Sun Aug 11, 2013 4:48 pm
Location: Pune

Re: JCL Tips.

Post by Quasar Chunawala »

9.In addition to the above tip, I'd like to post an interesting link about how "SPOOL" programs, HASP and JES2 were born.
http://www.redbug.org/dba/sharerpt/share79/o441.html
Last edited by zprogrammer on Wed Mar 12, 2014 9:53 pm, edited 1 time in total.
Reason: Added tip number
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Tip Of the Day.”