When learning the JCL DISP parameter, beginners often get confused about the terms Normal Disposition and Abnormal Disposition.
Every job step that is executed generates "return code". Famous return codes are 0,4,8,12,16..
If the job step does NOT abend, "normal dispostion" comes into effect. If the job step generates return code such as 8/12/16(any return code for that matter) still that is considered "normal disposition"
IF the job step abends with Sxxx (such as S0C4, SOC7, SB37, SE37, S322 etc) , Uxxx(user abend), "abnormal disposition" comes into effect.
This can be illustrated with following example
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=USERID.STEP1.DSN1,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB,
// SPACE=(TRK,(1,1),RLSE)
//DD2 DD DSN=USERID.STEP1.DSN2,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB,
// SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SET MAXCC=16
//*
//STEP2 EXEC PGM=SORT
//SORTIN DD DUMMY,LRECL=80,RECFM=FB
//SORTOUT DD DUMMY,LRECL=80,RECFM=FB
//SYSOUT DD SYSOUT=*
//DD1 DD DSN=USERID.STEP1.DSN2,
// DISP=(OLD,CATLG,DELETE)
//SYSIN DD *
INTENTIONALLY FORCING ABEND BY NOT GIVING PROPER CONTROL CARD
//*
The below JOB Log messages indicates that even thoug STEP1 genarated return code 16, still USERID.STEP1.DSN1, USERID.STEP1.DSN2 datasets are cataloged.
IEF142I USERIDS STEP1 - STEP WAS EXECUTED - COND CODE 0016
IEF285I USERID.USERIDS.JOB04476.D0000103.? SYSOUT
IGD104I USERID.STEP1.DSN1 RETAINED, DDNAME=DD1
IGD104I USERID.STEP1.DSN2 RETAINED, DDNAME=DD2
The below JOB Log messages indicates that since STEP2 abended with abend code U016, USERID.STEP1.DSN2 was deleted as coded in the DISP parameter.
IEF472I USERIDS STEP2 - COMPLETION CODE - SYSTEM=000 USER=0016 REASON=00000000
IEF285I USERID.USERIDS.JOB04476.D0000104.? SYSOUT
IGD105I USERID.STEP1.DSN2 DELETED, DDNAME=DD1
Every job step that is executed generates "return code". Famous return codes are 0,4,8,12,16..
If the job step does NOT abend, "normal dispostion" comes into effect. If the job step generates return code such as 8/12/16(any return code for that matter) still that is considered "normal disposition"
IF the job step abends with Sxxx (such as S0C4, SOC7, SB37, SE37, S322 etc) , Uxxx(user abend), "abnormal disposition" comes into effect.
This can be illustrated with following example
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=USERID.STEP1.DSN1,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB,
// SPACE=(TRK,(1,1),RLSE)
//DD2 DD DSN=USERID.STEP1.DSN2,
// DISP=(NEW,CATLG,DELETE),
// LRECL=80,RECFM=FB,
// SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SET MAXCC=16
//*
//STEP2 EXEC PGM=SORT
//SORTIN DD DUMMY,LRECL=80,RECFM=FB
//SORTOUT DD DUMMY,LRECL=80,RECFM=FB
//SYSOUT DD SYSOUT=*
//DD1 DD DSN=USERID.STEP1.DSN2,
// DISP=(OLD,CATLG,DELETE)
//SYSIN DD *
INTENTIONALLY FORCING ABEND BY NOT GIVING PROPER CONTROL CARD
//*
The below JOB Log messages indicates that even thoug STEP1 genarated return code 16, still USERID.STEP1.DSN1, USERID.STEP1.DSN2 datasets are cataloged.
IEF142I USERIDS STEP1 - STEP WAS EXECUTED - COND CODE 0016
IEF285I USERID.USERIDS.JOB04476.D0000103.? SYSOUT
IGD104I USERID.STEP1.DSN1 RETAINED, DDNAME=DD1
IGD104I USERID.STEP1.DSN2 RETAINED, DDNAME=DD2
The below JOB Log messages indicates that since STEP2 abended with abend code U016, USERID.STEP1.DSN2 was deleted as coded in the DISP parameter.
IEF472I USERIDS STEP2 - COMPLETION CODE - SYSTEM=000 USER=0016 REASON=00000000
IEF285I USERID.USERIDS.JOB04476.D0000104.? SYSOUT
IGD105I USERID.STEP1.DSN2 DELETED, DDNAME=DD1
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.