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.
Previous topicNext topic
User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

JCL Tips.

Post by Anuj Dhawan » Fri May 24, 2013 11:21 pm

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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Tue May 28, 2013 8:35 pm

2. Shops are usally 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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Wed May 29, 2013 11:55 pm

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
Active Member
Posts: 101
Joined: Sat Jun 08, 2013 8:13 pm
Zodiac: Leo

Re: JCL Tips.

Post by Angel » Mon Jun 10, 2013 10:30 am

Always wanted to know why number starts from "2" in JES2/3, thanks for sharing Anuj.



User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Mon Jun 10, 2013 7:59 pm

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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Sat Aug 10, 2013 10:47 pm

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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Tue Aug 13, 2013 11:26 am

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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: JCL Tips.

Post by Anuj Dhawan » Fri Sep 06, 2013 10:45 am

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

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

JCL Tips.

Post by Anuj Dhawan » Thu Oct 03, 2013 1:22 pm

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: 44
Joined: Sat Jun 15, 2013 12:54 pm
Zodiac: Sagittarius

Re: JCL Tips.

Post by RyanFox » Thu Oct 03, 2013 1:26 pm

Excellent collection. Can we use them in real environment right away?



User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

JCL Tips.

Post by Anuj Dhawan » Thu Oct 03, 2013 3:51 pm

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: 44
Joined: Sat Jun 15, 2013 12:54 pm
Zodiac: Sagittarius

Re: JCL Tips.

Post by RyanFox » Sun Oct 13, 2013 6:16 pm

Got your point, Thanks Anuj.




zprogrammer
Global Moderator
Global Moderator
Posts: 605
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars
Zodiac: Libra

Re: JCL Tips.

Post by zprogrammer » Thu Feb 20, 2014 6:13 pm

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: 35
Joined: Sun Aug 11, 2013 4:48 pm
Location: Pune
Zodiac: Aquarius

Re: JCL Tips.

Post by Quasar Chunawala » Wed Mar 12, 2014 9:46 pm

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



Previous topicNext topic

Return to “Tip Of the Day.”