JCL Reference
JCL Reference
parameters
(A-Z,0-9)
MSGLEVEL=(1,1) - Preferred
TYPRUN: SCAN/HOLD
SCAN: Checks for Syntax errors
HOLD: Puts the Job on hold, To release type ‘A’ against the
job in spool
Line Commands:
Command Prompts
RES – Resets
REF – Refresh the info
COLS – Displays the column numbers
SAVE – SAVEs a Dataset
SUB – Submit a Job
1. IEFBR14 – Dummy Utility to Create/Delete a Physical
Sequential dataset or a PDS
2. IEBGENER
Copy Seq files to Seq files
//STEP01 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=WPR085.INPUT1, DISP=SHR
//SYSUT2 DD DSN=WPR085.OUTPUT1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSPRINT DD SYSOUT=*
//*
3. IEBCOPY
(CREATES A PDS FROM AN EXISTING PDS AND COPIES ALL ITS
MEMBERS)
//STEP01 EXEC PGM=IEBCOPY
//DDIN DD DSN=WPR085.JCL.LIB,DISP=SHR
//DDOUT DD DSN=WPR085.JCL.LIB.BKUP,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1,1),RLSE),
// DCB=(RECFM=FB,DSORG=PO)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY OUTDD=DDOUT,INDD=DDIN
/*
//*
4. IEBCOMPR
Compares two Input files
//STEP01 EXEC PGM=IEBCOMPR
//SYSUT1 DD DSN=WPR085.INPUT1, DISP=SHR
//SYSUT2 DD DSN=WPR085.INPUT2, DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
D) Copies Input file to Output file and Sort first ten chars in
ascending order and within this sorted data, sort the file in
ascending order of a numeric field (21-25 columns)
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=WPR085.SORTIN,DISP=SHR
//SORTOUT DD DSN=WPR085.SORTOUT1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
SORT FIELDS=(1,10,CH,A,21,5,ZD,A)
/*
//SYSOUT DD SYSOUT=*
E) Copies Input file to Output file and Sort first ten chars in
descending order and copy selective records
G) Copies Input file to Output file and Sort first ten chars in
descending order and copy age greater than 40
6. TEMPERORY DATASETS
7. CONDITIONAL PROCESSING
COND PARM
COND=(4,LT)
COND=(4,NE,<STEPNAME>)
If the condition is true, it doesn’t execute. If it is
false, then it executes
COND=((4,NE,<STEPNAME>)AND(4,NE,<STEPNAME>))
// IF STEPNAME.RC = 0 THEN
//STEP01 EXEC PGM=TESTPGM1
// ELSE
//STEP02 EXEC PGM=TESTPGM2
// ENDIF
8. WRITING INSTREAM DATA INTO A FILE THRU JOB
PROCEDURE:
A PROC is nothing but a set of JOB steps without a Job card. It
is executable only thru a JCL.
Need for a PROC. A JCL cannot have more than 255 steps. So we
have a concept called PROC where the Job steps reside and it is
executed via a JCL. Also, in production environment, during
production issues, if we need to change any component in proc, it
is highly risky and this could be achieved thru overriding
parameters thru a JCL.
In JCL
//JOB CARD….
// JCLLIB ORDER DSN=WPR085.PROC.LIBRARY
//*
//STEP01 EXEC SORTPROC
//*