Title: JCL
1 JCL DAY 2
2EXEC STATEMENTS
- PGM COND
- PROC PARM
- ACCT REGION
- ADDRSPC TIME
- PERFORM
3IMPORTANT EXEC PARAMETERS
positional parameters (PGM
PROC)
ex. //STEP1 EXEC PGMIEFBR14
ex. //STEP1 EXEC PROCMYPROC
- The PGM parameter identifies the name of the
program that is - to be executed.
- The PROC parameter identifies the name of the
procedure that is - to be called.
4SEARCH SEQUENCE OF A PROGRAM
JOB PACK AREA
PAGEABLE LINK PACK AREA (PLPA)
JOB LIBRARY / STEP LIBRARY
FIXED LINK PACK AREA - FLPA
SYS1.LINKLIB
PGM NOT FOUND
MODIFIED LINK PACK AREA - MLPA
5MVS 370 memory map
Virtual Storage
16 MB
SQA
PLPA
Common area
CSA
Unallocated storage
Private area
User Region SWA
System Region
System area
Nucleus
0 MB
6IMPORTANT EXEC PARAMETERS keyword
parameters (PARM)
ex. //STEP1 EXEC PGMIEBUPDT,PARMMOD
- The PARM parameter is used to supply
information to a program - as it executes.
7IMPORTANT EXEC PARAMETERS keyword
parameters (ADDRSPC)
ex. //STEP1 EXEC PGMIEBUPDT, //
ADDRSPCVIRT
- The ADDRSPC parameter is to indicate to the
system that the job - step is to use either VIRT (virtual) or REAL
(real) storage.
- By default it is virtual.
8IMPORTANT EXEC PARAMETERS keyword
parameters (COND)
ex. //STEP3 EXEC PGMIEBUPDT,COND(8,LE,STEP1)
- The COND Permits the execution of steps to
depend on the - return code from the previous steps.
- The question should be is 8 less than the RC
code of STEP1. - If Yes then Bypass STEP3
- If No Execute STEP3
- The COND parameter is also a JOB parameter.
9IMPORTANT EXEC PARAMETERS keyword
parameters (COND)
TRUE
COND
BYPASS
FALSE
EXECUTE
10COND parameter in detail
Only code in the exec statement not in job
statement
Format COND( 0/4/6/8/12/16 ,
GT/GE/LT/LE/EQ/NE , step name , EVEN/ONLY )
RC comparison code (0 - 4095)
Condition
EVEN step will be executed even if previous
steps terminate abnormally ONLY step will be
executed only if previous steps terminate
abnormally.
11COND parameter examples (in JOB
statement)
000100 //INF6244A JOB COND(4,LT) 000200
//STEP1 EXEC PGMIEFBR14 000300 //STEP2 EXEC
PGMIFBR14 000400 //STEP3 EXEC PGMIEFBR14
- STEP2 executes with RC S806 that is it is
greater than 4
12COND parameter examples (in EXEC
statement)
000100 //INF6244A JOB
000200 //STEP1 EXEC PGMIEFBR14
000300 //STEP2 EXEC
PGMIEFBR14,COND(0,EQ,STEP1)
13COND parameter examples (in EXEC
statement)
000100 //INF6244A JOB
000200 //STEP1 EXEC PGMIEFBR14
000300 //STEP2 EXEC PGMIEFBR14,CONDONLY
000100 //INF6244A JOB 000200
//STEP1 EXEC PGMIFBR14 000210
//STEP2 EXEC PGMIEFBR14 000220
//STEP3 EXEC PGMIEFBR14,CONDONLY
- STEP1 abends with RC S806
- STEP2 does not execute ( if a single step abends
all other steps - are bypassed if no COND statement is there )
14COND parameter examples (in EXEC
statement)
000100 //INF6244A JOB 000210
//STEP1 EXEC PGMIEFBR14 000300 //STEP2
EXEC PGMIEFBR14,CONDEVEN
000100 //INF6244A JOB 000200
//STEP1 EXEC PGMIFBR14 000210 //STEP2
EXEC PGMIEFBR14 000220 //STEP3 EXEC
PGMIEFBR14,CONDEVEN
- STEP1 abends with RC S806
- STEP2 does not execute ( if a single step abends
all other steps - are bypassed if no COND statement is there )
15COND parameter examples (in EXEC
statement)
//INF6244A JOB //STEP1
EXEC PGMIEFBR14 //STEP2 EXEC
PGMIEFBR14 //STEP3 EXEC
PGMIEFBR14, //
COND((0,NE,STEP2),ONLY)
000100 //INF6244A JOB 000200
//STEP1 EXEC PGMIEFBR14 000210 //STEP2
EXEC PGMIEFBR14 000220 //STEP3 EXEC
PGMIEFBR14, 000230 //
COND((0,NE,STEP2))
16COND parameter examples (in EXEC
statement)
000100 //INF6244A JOB
000200 //STEP1 EXEC PGMIEFBR14
000210 //STEP2 EXEC PGMIEFBR14
000220 //STEP3 EXEC PGMIEFBR14,
000230 //
COND((0,NE,STEP2),(0,NE,STEP1))
000100 //INF6244A JOB
000200 //STEP1 EXEC PGMIEFBR14
000210 //STEP2 EXEC PGMIEFBR14
000220 //STEP3 EXEC PGMIEFBR14,
000230 //
COND((0,NE,STEP2),(0,EQ,STEP1))
17COND parameter examples (STEP overriding
JOB)
000100 //INF6244A JOB COND(0,NE)
000200 //STEP1 EXEC PGMIEFBR14
000210 //STEP2 EXEC PGMIEFBR14
000220 //STEP3 EXEC PGMIEFBR14
000100 //INF6244A JOB COND(0,NE)
000200 //STEP1 EXEC PGMIEFBR14
000210 //STEP2 EXEC PGMIEFBR14
000220 //STEP3 EXEC PGMIEFBR14,COND(0,EQ,STE
P2)
- STEP3 executes with RC FFLUSH
18IMPORTANT EXEC PARAMETERS keyword
parameters (IF/THEN/ELSE/ENDIF)
ex. // IF (STEPA.RC GE 4) THEN //jcl
statements // ELSE //jcl statements
// ENDIF
- The IF/THEN/ELSE/ENDIF statement construct
provides a simple - means of selectively executing job steps.
- It is available in Release 4 or later , of
MVS/ESA and eliminates - the need to struggle with the COND parameter.
19IF/THEN/ELSE/ENDIF parameter examples
000100 //INF6244A JOB 2933100P,AMLAN,MSGCLASSA,C
LASSA 000120 //STEP1 EXEC PGMIEFBR14
000121 // IF (STEP1.RC GT 0) THEN
000130 //STEP3 EXEC
PGMIEFBR14 000150 //DD1
DD DSNINF6244.TRUE.PS,DISP(NEW,CATLG),
000160 // VOLSERINUSR2,
000170 // SPACE(TRK,(1,1)),
000180 // DCB(LRECL80,BLKSIZ
E800,RECFMFB) 000190 // ELSE
000191 //STEP4 EXEC
PGMIEFBR14 000200 //DD2
DD DSNINF6244.FALSE.PS,DISP(NEW,CATLG),
000300 // VOLSERINUSR2,
000400 // SPACE(TRK,(1,1)),
000500 // DCB(LRECL80,BLKSIZ
E800,RECFMFB) 000600 // ENDIF
000610 /
STEPNAME PROCSTEP RC STEP1
00 STEP3
FLUSH STEP4
00
20COMMON keyword PARAMETERS in JOB
EXEC
TIME COND REGION
21DD STATEMENTS
- ddname DD
- VOL DATA
- DCB SYSOUT
- DSN DUMMY
- UNIT DLM
- DISP SYSUDUMP
- SYSMDUMP SYSABEND
- REFERBACK JOBLIB
- STEPLIB
-
22DSN
- Qualified Name separated by periods
- each
name 1 to 8 chars - total
44 characters including periods
- Temporary data sets TEMP or do not mention
DSN -
parameter
23DISP
- NEW ,DELETE ,DELETE
- OLD ,KEEP ,KEEP
- DISP SHR ,CATLG ,CATLG
- MOD ,UNCATLG ,UNCATLG
- ,PASS
24DCB
- LRECLn (VALUE IN BYTES)
- RECFM(F/FB/V/VB/U)
- BLKSIZE multiple of LRECL
- DSORG(PS/PO/DA)
25SPACE
- SPACE(space units,(primary,secondary,dir),RLSE)
- space unit - TRK(tracks)/CYL(cylinders)/BLOCKSIZE
in - bytes
- eg SPACE(1024,(100,200)
- SPACE(TRK,(10,5) - allocate 10 tracks
primarily and if - required as secondary allocation 5 tracks
26UNIT
- Hardware address
- Type
- Group
// UNIT0320
OR // UNIT3390
OR //
UNITSYSDA
To use the same unit that has been used by prior
DD statement // UNITAFFddname
27VOL
- It is used to specify a disk volume or specific
tapes.
// VOLSERINUSR2,UNITSYSDA
To referback a volume used by some prior DD
statement use //
VOLREFddname
28SYSOUT
- SYSOUT is used to route output to a device.
// DDNAME DD SYSOUTA
If you want to send the output to the same device
described by MSGCLASS of the job use
// DDNAME DD SYSOUT
29 JOBLIB STATEMENTS
ex. //INFOSYS1 JOB //JOBLIB DD
DSNINFOSYS.COMPLIB.LOAD,
- // DISP
(what should be the disposition)
- The JOBLIB statement defines the library where
the program is - residing. It is placed after the JOB statement
and is effective for - every JOB steps.
30 STEPLIB STATEMENTS
ex. //STEP1 EXEC PGMINHOUSE //STEPLIB
DD DSNINFOSYS.COMPLIB.LOAD,
- // DISP
(what should be the disposition)
- The STEPLIB statement defines the library where
the program is - residing. It is placed after the EXEC statement
and is effective for - that particular step and overrides any JOBLIB
statement.
31The first JCL to create a PS.
//AMLANX JOB 1234,AMLAN,CLASSA,MSGCLASS(1,1)
TO CREATE PS
//STEP1 EXEC PGMIEFBR14
//PS1 DD DSNAMLAN.FLOWER.ROSE,UNITSYSDA,VOLSER
INUSR2, // DCB(LRECL80,RECFMFB,BLK
SIZE800),SPACE(TRK,(1,1)), //
DISP(NEW,CATLG)
32Thats all for DAY 2