//FSOJCL    JCLLIB ORDER=(&SRRHLQ..CNTL)
//*--------------------------------------------------------------------
//*-------------------------->> CACJ0002 <<----------------------------
//*--------------------------------------------------------------------
//*          GENERATE DSNLIST FOR SENSITIVE LIBRARY REPORTS
//*
//*  THIS JOB WILL CREATE A DATA SET THAT CONTAINS A LIST OF DATA SETS
//*  TO BE USED AS INPUT TO THE SENSITIVE LIBRARY REPORTS JOB.
//*
//*
//*  STEP1:           REMOVES PREVIOUS RUNS DATASETS
//*  STEP2:           ALLOCATES DATASETS FOR THIS RUN
//*  STEP3:           PGM OBTAINS DATASETS ENQ FOR ALL ACTIVE APPS.
//*  STEP4:           SORT LIST OF DATASETS FROM ACTIVE APPS.
//*  STEP5:           EXAMINES THE FOLLOWING DATA SET TO OBTAIN A LIST
//*                   OF DATA SETS TO BE REVIEWED.
//*
//*                   SYS1.PARMLIB(IEASYS00)
//*                   JES PARMETER DATA SET
//*                   &SRRHLQ..EXAM.RPT
//*                   &SRRHLQ..CNTL(DSNLIST)
//*
//*  STEP6:           GENS PDIS FROM INFORMATION OBTAINED IN
//*                   EXAMINE RPTS.
//*
//*  ===> NOTE:  STEP5 AND STEP6 MAY END WITH A CONDITION CODE OF 0
//*              ALTHOUGH ERRORS OCCURRED.  REVIEW THE ISPLOG AND
//*              SYSTSPRT FILES OF EACH REPORT STEP, ALONG WITH THE
//*              JOBLOG OR JESLOG FILES, FOR ERROR MESSAGES AND TO
//*              ENSURE SUCCESSFUL EXECUTION.
//*--------------------------------------------------------------------
//*
//*
//STEP1     EXEC PGM=IEFBR14
//TEMP1     DD DSN=&SRRHLQ..TEMP1,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(TRK,0),UNIT=SYSDA
//TEMP2     DD DSN=&SRRHLQ..TEMP2,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(TRK,0),UNIT=SYSDA
//TEMP3     DD DSN=&SRRHLQ..TEMP3,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(TRK,0),UNIT=SYSDA
//*
//STEP2     EXEC PGM=IEFBR14
//TEMP1     DD DSN=&SRRHLQ..TEMP1,
//             DISP=(NEW,CATLG,DELETE),
//*            DATACLAS=ALLOCX1V,   <--- USE IF SMS RULE APPLIES
//             UNIT=(SYSDA,1),
//             SPACE=(TRK,(15,15,15)),
//             DCB=(RECFM=FB,LRECL=81,BLKSIZE=27864,DSORG=PO)
//TEMP2     DD DSN=&SRRHLQ..TEMP2,
//             DISP=(NEW,CATLG,DELETE),
//*            DATACLAS=ALLOCX1V,   <--- USE IF SMS RULE APPLIES
//             UNIT=(SYSDA,1),
//             SPACE=(TRK,(15,15,15)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920,DSORG=PO)
//*
//STEP3     EXEC PGM=CACPGRS0
//STEPLIB   DD DSN=&SRRHLQ..LOADLIB,
//             DISP=SHR
//SYSPRINT  DD DSN=&&SYSPRINT,
//             DISP=(NEW,PASS),
//             UNIT=VIO,
//             SPACE=(TRK,(15,15)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920,DSORG=PS)
//*
//***      SORT BY JOBNAME/DSNAME
//*
//STEP4     EXEC PGM=SORT
//SORTMSG   DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SORTWK01  DD UNIT=VIO,SPACE=(CYL,(5))
//SORTIN    DD DSN=&&SYSPRINT,
//             DISP=(OLD,DELETE,DELETE)
//SORTOUT   DD DSN=&SRRHLQ..TEMP2(GRSILIST),
//             DISP=OLD
//SYSIN     DD *
  SORT FIELDS=(1,80,AQ,A)
  END
//*
//STEP5     EXEC EXAMRPTS,
//             CNTL=&SRRHLQ..CNTL
//EXAMRPT   DD DSN=&SRRHLQ..EXAM.RPT,
//             DISP=SHR
//CNTL      DD DSN=&SRRHLQ..TABLE,
//             DISP=SHR
//          DD DSN=&SRRHLQ..CNTL,
//             DISP=SHR
//PDIDD     DD DSN=&SRRHLQ..PDI,
//             DISP=OLD
//TEMP1     DD DSN=&SRRHLQ..TEMP1,
//             DISP=OLD
//TEMP2     DD DSN=&SRRHLQ..TEMP2,
//             DISP=OLD
//TEMP3     DD DSN=&SRRHLQ..TEMP3,
//             DISP=(NEW,CATLG,DELETE),
//*            DATACLAS=ALLOCX1V,   <--- USE IF SMS RULE APPLIES
//             UNIT=SYSDA,
//             SPACE=(TRK,(15,15)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920,DSORG=PS)
//SYSTSIN   DD *
  ISPSTART CMD(%CACC0001 TERMMSGS(ON) TYPERUN(FSO))
/*
//STEP6     EXEC EXAMRPTS,
//             CNTL=&SRRHLQ..CNTL
//EXAMRPT   DD DSN=&SRRHLQ..EXAM.RPT,
//             DISP=OLD
//CNTL      DD DSN=&SRRHLQ..CNTL,
//             DISP=SHR
//PDIDD     DD DSN=&SRRHLQ..PDI,
//             DISP=OLD
//SYSTSIN   DD *
  ISPSTART CMD(%CACC0050 TERMMSGS(ON))
/*
//
