I have been requested to use conditional codes in the Job attached. Currently our Job do not stop at an abend step.They want job should stop at an abend.
I am new to JCL.
I do have some programing experience in other languages (PL/SQL, SQL).
//*-----------------------------------------------------------------*
//* DELETE/DEFINE IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//IMF1 EXEC PGM=IDCAMS
//DD1 DD DISP=OLD,DSN=IMSTESTA.IMFTABLE
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (IMSTESTA.IMFTABLE) CLUSTER PURGE
DEFINE CLUSTER( -
NAME(IMSTESTA.IMFTABLE) -
FREESPACE(0 0) -
INDEXED -
KEYS(24 0) -
RECORDSIZE(80 80) -
SHAREOPTIONS(3 3) -
ERASE -
UNIQUE -
CYLINDERS(40 10) -
) -
DATA( -
NAME(IMSTESTA.IMFTABLE.DATA) -
CONTROLINTERVALSIZE(8192) -
) -
INDEX( -
NAME(IMSTESTA.IMFTABLE.INDEX) -
CONTROLINTERVALSIZE(8192))
/*
//*
//*-----------------------------------------------------------------*
//* DO LISTCAT OF IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//LISTCAT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(IMSTESTA.IMFTABLE) ALL
//*
//*-----------------------------------------------------------------*
//* SORT DATA BEFORE REPRO INTO VSAM FILE *
//*-----------------------------------------------------------------*
//*
//SORT EXEC PGM=SORT
//SORTIN DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(DEFAULT)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(CWS)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(TCIS0223)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(PDB) ## 10/28/11
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(ETRS1211)
//SORTOUT DD DISP=(,CATLG,DELETE),
// DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(+1),
// SPACE=(CYL,(10,10)),UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//* SORT FIELDS=(1,32,CH,A)
//SYSIN DD *
SORT FIELDS=(1,32,CH,A)
SUM FIELDS=NONE
/*
//*-----------------------------------------------------------------*
//* PRINT SORTED DATA (FOR VALIDATION) *
//*-----------------------------------------------------------------*
//*
//*PRINT EXEC PGM=IEBGENER
//*SYSUT1 DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(0)
//*SYSUT2 DD SYSOUT=*
//*SYSPRINT DD SYSOUT=*
//*SYSIN DD DUMMY
//*
//*
//*-----------------------------------------------------------------*
//* BUILD IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//PRINTO DD SYSOUT=*
//INPUT DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(0)
//OUTPUT DD DISP=OLD,DSN=IMSTESTA.IMFTABLE
//SYSIN DD *
REPRO INFILE(INPUT) OUTFILE(OUTPUT)
END
/*
//*-------------------------------------------------------*
//* TELL OPERATIONS THAT THIS JOB FAILED DUE TO ABEND *
//*-------------------------------------------------------*
//ABEND1 EXEC PGM=ITDWTOR,COND=ONLY
//STEPLIB DD DSN=IMSB.PGMLIB,DISP=SHR
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=IMSTESTA.CNTRL(IMFTBLE),DISP=SHR
//*
REPRO INDATASET(IMSTESTA.IMF310.ITD.SOURCE(IMFTABLE)) -
OUTDATASET(IMSTESTA.IMFTABLE)
END
//* DELETE/DEFINE IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//IMF1 EXEC PGM=IDCAMS
//DD1 DD DISP=OLD,DSN=IMSTESTA.IMFTABLE
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (IMSTESTA.IMFTABLE) CLUSTER PURGE
DEFINE CLUSTER( -
NAME(IMSTESTA.IMFTABLE) -
FREESPACE(0 0) -
INDEXED -
KEYS(24 0) -
RECORDSIZE(80 80) -
SHAREOPTIONS(3 3) -
ERASE -
UNIQUE -
CYLINDERS(40 10) -
) -
DATA( -
NAME(IMSTESTA.IMFTABLE.DATA) -
CONTROLINTERVALSIZE(8192) -
) -
INDEX( -
NAME(IMSTESTA.IMFTABLE.INDEX) -
CONTROLINTERVALSIZE(8192))
/*
//*
//*-----------------------------------------------------------------*
//* DO LISTCAT OF IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//LISTCAT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(IMSTESTA.IMFTABLE) ALL
//*
//*-----------------------------------------------------------------*
//* SORT DATA BEFORE REPRO INTO VSAM FILE *
//*-----------------------------------------------------------------*
//*
//SORT EXEC PGM=SORT
//SORTIN DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(DEFAULT)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(CWS)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(TCIS0223)
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(PDB) ## 10/28/11
// DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(ETRS1211)
//SORTOUT DD DISP=(,CATLG,DELETE),
// DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(+1),
// SPACE=(CYL,(10,10)),UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//* SORT FIELDS=(1,32,CH,A)
//SYSIN DD *
SORT FIELDS=(1,32,CH,A)
SUM FIELDS=NONE
/*
//*-----------------------------------------------------------------*
//* PRINT SORTED DATA (FOR VALIDATION) *
//*-----------------------------------------------------------------*
//*
//*PRINT EXEC PGM=IEBGENER
//*SYSUT1 DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(0)
//*SYSUT2 DD SYSOUT=*
//*SYSPRINT DD SYSOUT=*
//*SYSIN DD DUMMY
//*
//*
//*-----------------------------------------------------------------*
//* BUILD IMFTABLE VSAM FILE *
//*-----------------------------------------------------------------*
//*
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//PRINTO DD SYSOUT=*
//INPUT DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(0)
//OUTPUT DD DISP=OLD,DSN=IMSTESTA.IMFTABLE
//SYSIN DD *
REPRO INFILE(INPUT) OUTFILE(OUTPUT)
END
/*
//*-------------------------------------------------------*
//* TELL OPERATIONS THAT THIS JOB FAILED DUE TO ABEND *
//*-------------------------------------------------------*
//ABEND1 EXEC PGM=ITDWTOR,COND=ONLY
//STEPLIB DD DSN=IMSB.PGMLIB,DISP=SHR
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=IMSTESTA.CNTRL(IMFTBLE),DISP=SHR
//*
REPRO INDATASET(IMSTESTA.IMF310.ITD.SOURCE(IMFTABLE)) -
OUTDATASET(IMSTESTA.IMFTABLE)
END