Sunday, June 10, 2007

JCL

TIP # 023
JCL

Hero's Method:
If you prefer a dataset to be not deleted accidentally, then
---------------------------------------------------------------------------------------------------------------------
USING IDCAMS USING JCL COMMENTS
---------------------------------------------------------------------------------------------------------------------
TO(04365) LABEL=RETPD=04365 Will protect till end of 2004
FOR(30) LABEL=RETPD=10 Will protect for 30 days
---------------------------------------------------------------------------------------------------------------------
Villain's Method:
If by chance of fate, you want to delete a dataset that is protected by the above method...
Use IDCAMS DELETE command with PURGE option.
e.g.,
//STEP1 EXEC PGM=EXEC
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE TOP.SECRET.DATA -
PURGE
/*

TIP # 024
JCL

Is it possible to execute a program from any library using the referback?
The Answer is Yes!
//STEP1 EXEC PGM=IEFBR14
//PROGRAM DD DSN=SYSTEM.PGM.LOADLIB(COBOLPGM),DISP=SHR
//STEP2 EXEC PGM=*.STEP1.PROGRAM

TIP # 025
JCL

How does the system differentiates between JCL comment statements (i.e., //* statements) and
JES3 Statements (which also start with //* ) ?
If the 4th column contains JES3 keyword, the line is considered to be JES3 statement, else it is
considered as normal JCL statement.

TIP # 026
JCL

We know JES2 and JES3 , but is there any JES1?
OS/VS1 (the forefather of MVS) supported only one job entry subsystem namely JES1

TIP # 027
JCL

Consider this situation.
I have a JCL with 10 steps.
For reasons known only to me, I want to execute step 5 only.
How can I do it?

One way to do it is to use RESTART from STEP05, but it will try to execute the
subsequent steps too.
We have to insert null statement after step05 to prevent the execution of
subsequent steps.
But one decent way is there in which we don’t need to touch the job steps
code, but alter only the Jobcard.
And that is....
In the JOBCARD, code COND parameter. Then, when the Job is executed , only
the Step mentioned in the RESTART parameter will get executed.
e.g., RESTART=STEP05,COND=(0,LE)

TIP # 028
JCL

We know that JOBLIB statement must be placed after the JOB statement and before the first
EXEC statement in the job.
But, the STEPLIB statement can be placed anywhere in the particular step’s JCL (not necessarily
the first DD statement in the STEP).

TIP # 029
JCL

Here is a quick question. Can Catalog Procedure have PEND
statement?
Yes! Now it can have PEND Statement.
Do check it out….

TIP # 030
JCL

How much data can TAPE store??
A typical tape reel might contain 170 MB whereas tape cartridges can contain as much as
10GB.
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 031
JCL

Do you know why null statement was introduced in JCL?
Back when punched cards were used, a null coded on distinctive colored cards was used to help
operators separate card decks. ( Hence , it helped to identify the end-of-job card, and the start of
next job for the operators)
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 032
JCL

Do you know why JCL has ‘//’ in col 1& 2 in each Statement??
The Slashes date back from when PUNCHED CARDS were used to submit JCL code for
execution. If the cards were mistakenly put back to front in the reader, the slashes wouldn’t be
read first and so the card deck could be rejected. So ‘//’ ensures that the punched cards are placed
properly!!
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 033
JCL

How can I specify dummy VSAM dataset in a JCL?
Code AMP=’AMORG’ . This parameter tells the OS to treat the file as VSAM file.
//NOVSAMIO DD DUMMY,AMP=’AMORG’

TIP # 034
JCL

I can specify the max limit of TIME parameter as
TIME=NOLIMIT or
TIME=MAXIMUM.

Now which specification gives maximum time for a JOB?
TIME=MAXIMUM will allow the job to run for 357912 minutes (248.55 days)
TIME=NOLIMIT will allow the job for unlimited amount of time
Another advantage of NOLIMIT option is that it can remain in wait status for more than the installation
time limit.

TIP # 035
JCL

I want to delete a member in a PDS, but someone is using it. How can I delete it?
One can use the following JCL
//DELMEMB EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//PDS DD DSN=libraryname,DISP=SHR
//SYSIN DD *
ALLOC DDN(INFILE) SHR REUSE DSN('libraryname')
DELETE libraryname(membername) FILE(PDS)

TIP # 036
JCL

&SYSUID is a "system symbol" for which the system substitutes your TSO ID.
It is the only system symbol that can be used in a batch job, and can be useful when more than one
individual submits the same JCL.

TIP # 037
JCL

I am overriding 2 DD statements in a PROC from my JCL. The first DD statement is in step 10 and
second DD statement is in step 40.
Usually , I specify as
//PS010.INPUT DD DSN=MYID.DATASET
//PS040.SYSIN DD DSN= MYID.NEW.DATASET
What will happen if I specify step 40 first and step 10 next?
zOS JCL will process it! It will override irrespective of the order it is specified. Formerly out-of-order DD
overrides were ignored.

3 comments:

Joy said...

Thanks for the post

You can find some good JCL Techical Interview Question Answers on in the below link

JCL Technical Interview Question Database

Thanks
Joya

Vanz-LovePrince$$ said...

i wish to know the difference between Cataloged and Instream procedure. could you post the reply by evening?

Vanz-LovePrince$$ said...

i wish to know the difference between Cataloged and Instream procedure. could you post the reply by evening?