baseline jcl day2

32
06/13/2 2 1 ER/CORP/CRS/OS02/003-2 JCL DAY 2

Upload: api-27095622

Post on 07-Jun-2015

340 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: baseline jcl day2

04/12/23 1

ER/CORP/CRS/OS02/003-2

JCL

DAY 2

Page 2: baseline jcl day2

04/12/23 2

ER/CORP/CRS/OS02/003-2

EXEC STATEMENTS

PGM COND

PROC PARM

ACCT REGION

ADDRSPC TIME

PERFORM

Page 3: baseline jcl day2

04/12/23 3

ER/CORP/CRS/OS02/003-2

IMPORTANT EXEC PARAMETERS positional parameters (PGM & PROC)

ex. //STEP1 EXEC PGM=IEFBR14

• The PGM parameter identifies the name of the program that is to be executed.

ex. //STEP1 EXEC PROC=MYPROC

• The PROC parameter identifies the name of the procedure that is to be called.

Page 4: baseline jcl day2

04/12/23 4

ER/CORP/CRS/OS02/003-2

SEARCH SEQUENCE OF A PROGRAM

JOB PACK AREA

JOB LIBRARY /STEP LIBRARY

FIXED LINK PACKAREA - FLPA

MODIFIED LINK PACKAREA - MLPA

SYS1.LINKLIB

PAGEABLE LINK PACKAREA (PLPA)

PGM NOTFOUND

Page 5: baseline jcl day2

04/12/23 5

ER/CORP/CRS/OS02/003-2

MVS 370 memory map

Nucleus

System Region

User Region

SWA

Unallocated storage

CSA

PLPA

SQA

Common area

Private area

System area

Virtual Storage

0 MB

16 MB

Page 6: baseline jcl day2

04/12/23 6

ER/CORP/CRS/OS02/003-2

IMPORTANT EXEC PARAMETERS keyword parameters (PARM)

ex. //STEP1 EXEC PGM=IEBUPDT,PARM=MOD

• The PARM parameter is used to supply information to a program as it executes.

Page 7: baseline jcl day2

04/12/23 7

ER/CORP/CRS/OS02/003-2

IMPORTANT EXEC PARAMETERS keyword parameters (ADDRSPC)

ex. //STEP1 EXEC PGM=IEBUPDT, // ADDRSPC=VIRT

• 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.

Page 8: baseline jcl day2

04/12/23 8

ER/CORP/CRS/OS02/003-2

IMPORTANT EXEC PARAMETERS keyword parameters (COND)

ex. //STEP3 EXEC PGM=IEBUPDT,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.

Page 9: baseline jcl day2

04/12/23 9

ER/CORP/CRS/OS02/003-2

IMPORTANT EXEC PARAMETERS keyword parameters (COND)

COND =

FALSE

TRUE

EXECUTE

BYPASS

Page 10: baseline jcl day2

04/12/23 10

ER/CORP/CRS/OS02/003-2

COND parameter in detail

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 stepsterminate abnormally.

Only code in the exec statementnot in job statement

Page 11: baseline jcl day2

04/12/23 11

ER/CORP/CRS/OS02/003-2

COND parameter examples (in JOB statement) 000100 //INF6244A JOB COND=(4,LT) 000200 //STEP1 EXEC PGM=IEFBR14 000300 //STEP2 EXEC PGM=IFBR14 000400 //STEP3 EXEC PGM=IEFBR14

• STEP1 executes with RC = 0

• STEP2 executes with RC *S806 that is it is greater than 4

• Job terminates

Page 12: baseline jcl day2

04/12/23 12

ER/CORP/CRS/OS02/003-2

COND parameter examples (in EXEC statement)

000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IEFBR14 000300 //STEP2 EXEC PGM=IEFBR14,COND=(0,EQ,STEP1)

• STEP1 executes with RC = 0

• STEP2 does not execute

Page 13: baseline jcl day2

04/12/23 13

ER/CORP/CRS/OS02/003-2

COND parameter examples (in EXEC statement)

000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IEFBR14 000300 //STEP2 EXEC PGM=IEFBR14,COND=ONLY

• STEP1 executes with RC = 0

• STEP2 does not execute

000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14,COND=ONLY

• 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 )

• STEP3 executes with RC = 0

Page 14: baseline jcl day2

04/12/23 14

ER/CORP/CRS/OS02/003-2

COND parameter examples (in EXEC statement)

000100 //INF6244A JOB 000210 //STEP1 EXEC PGM=IEFBR14 000300 //STEP2 EXEC PGM=IEFBR14,COND=EVEN

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0

000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14,COND=EVEN

• 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 )

• STEP3 executes with RC = 0

Page 15: baseline jcl day2

04/12/23 15

ER/CORP/CRS/OS02/003-2

COND parameter examples (in EXEC statement)

//INF6244A JOB //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14 //STEP3 EXEC PGM=IEFBR14,

// COND=((0,NE,STEP2),ONLY)

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0 000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IEFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14, 000230 // COND=((0,NE,STEP2))

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0

• STEP3 executes with RC = 0

• STEP3 does not execute

Page 16: baseline jcl day2

04/12/23 16

ER/CORP/CRS/OS02/003-2

COND parameter examples (in EXEC statement)

000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IEFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14, 000230 // COND=((0,NE,STEP2),(0,NE,STEP1))

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0 000100 //INF6244A JOB 000200 //STEP1 EXEC PGM=IEFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14, 000230 // COND=((0,NE,STEP2),(0,EQ,STEP1))

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0

• STEP3 does not execute

• STEP3 executes with RC = 0

Page 17: baseline jcl day2

04/12/23 17

ER/CORP/CRS/OS02/003-2

COND parameter examples (STEP overriding JOB)

000100 //INF6244A JOB COND=(0,NE) 000200 //STEP1 EXEC PGM=IEFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0

000100 //INF6244A JOB COND=(0,NE) 000200 //STEP1 EXEC PGM=IEFBR14 000210 //STEP2 EXEC PGM=IEFBR14 000220 //STEP3 EXEC PGM=IEFBR14,COND=(0,EQ,STEP2)

• STEP3 executes with RC = 0

• STEP1 executes with RC = 0

• STEP2 executes with RC = 0

• STEP3 executes with RC = FFLUSH

Page 18: baseline jcl day2

04/12/23 18

ER/CORP/CRS/OS02/003-2

IMPORTANT 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.

Page 19: baseline jcl day2

04/12/23 19

ER/CORP/CRS/OS02/003-2

IF/THEN/ELSE/ENDIF parameter examples

000100 //INF6244A JOB 2933100P,AMLAN,MSGCLASS=A,CLASS=A 000120 //STEP1 EXEC PGM=IEFBR14 000121 // IF (STEP1.RC GT 0) THEN 000130 //STEP3 EXEC PGM=IEFBR14 000150 //DD1 DD DSN=INF6244.TRUE.PS,DISP=(NEW,CATLG), 000160 // VOL=SER=INUSR2, 000170 // SPACE=(TRK,(1,1)), 000180 // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) 000190 // ELSE 000191 //STEP4 EXEC PGM=IEFBR14 000200 //DD2 DD DSN=INF6244.FALSE.PS,DISP=(NEW,CATLG), 000300 // VOL=SER=INUSR2, 000400 // SPACE=(TRK,(1,1)), 000500 // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) 000600 // ENDIF 000610 /* STEPNAME PROCSTEP RC

STEP1 00 STEP3 FLUSH

STEP4 00

Page 20: baseline jcl day2

04/12/23 20

ER/CORP/CRS/OS02/003-2

COMMON keyword PARAMETERS in JOB & EXEC

TIME

COND

REGION

Page 21: baseline jcl day2

04/12/23 21

ER/CORP/CRS/OS02/003-2

DD STATEMENTS

ddname DD *

VOL DATA

DCB SYSOUT

DSN DUMMY

UNIT DLM

DISP SYSUDUMP

SYSMDUMP SYSABEND

REFERBACK JOBLIB

STEPLIB

Page 22: baseline jcl day2

04/12/23 22

ER/CORP/CRS/OS02/003-2

DSN

• The name of the data set

• Simple Name : 1 to 8 chars

• 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

• Refer back : DSN=*.STEP1.DD1

Page 23: baseline jcl day2

04/12/23 23

ER/CORP/CRS/OS02/003-2

DISP

NEW ,DELETE ,DELETE

OLD ,KEEP ,KEEP

DISP= SHR ,CATLG ,CATLG

MOD ,UNCATLG ,UNCATLG

,PASS

Page 24: baseline jcl day2

04/12/23 24

ER/CORP/CRS/OS02/003-2

DCB

LRECL=n (VALUE IN BYTES)

RECFM=(F/FB/V/VB/U)

BLKSIZE= multiple of LRECL

DSORG=(PS/PO/DA)

Page 25: baseline jcl day2

04/12/23 25

ER/CORP/CRS/OS02/003-2

SPACE

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

Page 26: baseline jcl day2

04/12/23 26

ER/CORP/CRS/OS02/003-2

UNIT• Hardware address• Type• Group

// UNIT=0320 OR// UNIT=3390 OR // UNIT=SYSDA

To use the same unit that has been used by prior DD statement// UNIT=AFF=ddname

Page 27: baseline jcl day2

04/12/23 27

ER/CORP/CRS/OS02/003-2

VOL

• It is used to specify a disk volume or specific tapes.

// VOL=SER=INUSR2,UNIT=SYSDA

To referback a volume used by some prior DD statement use:// VOL=REF=ddname

Page 28: baseline jcl day2

04/12/23 28

ER/CORP/CRS/OS02/003-2

SYSOUT

// DDNAME DD SYSOUT=CLASS

• SYSOUT is used to route output to a device.

// DDNAME DD SYSOUT=A

If you want to send the output to the same device described by MSGCLASS of the job use

// DDNAME DD SYSOUT=*

Page 29: baseline jcl day2

04/12/23 29

ER/CORP/CRS/OS02/003-2

JOBLIB STATEMENTS

ex. //INFOSYS1 JOB //JOBLIB DD DSN=INFOSYS.COMPLIB.LOAD,

• 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.

• // DISP = (what should be the disposition)• // DISP = SHR

• //STEP1 EXEC PGM=INHOUSE

Page 30: baseline jcl day2

04/12/23 30

ER/CORP/CRS/OS02/003-2

STEPLIB STATEMENTS

ex. //STEP1 EXEC PGM=INHOUSE //STEPLIB DD DSN=INFOSYS.COMPLIB.LOAD,

• 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.

• // DISP = (what should be the disposition)• // DISP = SHR

Page 31: baseline jcl day2

04/12/23 31

ER/CORP/CRS/OS02/003-2

The first JCL to create a PS.

//AMLANX JOB 1234,AMLAN,CLASS=A,MSGCLASS=(1,1) TO CREATE PS

//STEP1 EXEC PGM=IEFBR14

//PS1 DD DSN=AMLAN.FLOWER.ROSE,UNIT=SYSDA,VOL=SER=INUSR2,// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),SPACE=(TRK,(1,1)),// DISP=(NEW,CATLG)

Page 32: baseline jcl day2

04/12/23 32

ER/CORP/CRS/OS02/003-2

That’s all for

DAY

2