//DIALOGDS SET DIALOG=&SRRHLQ..DATA         <<---- CHANGE TO DIALOG DS
//FSOJCL   JCLLIB ORDER=(&SRRHLQ..CNTL)
//*--------------------------------------------------------------------
//*-------------------------->> CAAJ0001 <<----------------------------
//*--------------------------------------------------------------------
//*                      GENERATE CHAP REPORTS
//*
//*  IMPORTANT:  Copy member JOBCARD to the beginning of this job.
//*
//*  THIS JOB EXECUTES NUMEROUS CLIST AND EDIT MACROS TO GENERATE
//*  A REPORT OF ACCESSES OF SYSTEM LIBRARIES/FILES.
//*
//*  STEP1:           Delete data sets created in this JOB.
//*  STEP2:           Generates a report of logonids and UID string.
//*  STEP3:           Reads TEMP3 (DSNLIST data set collection)
//*                   and queries ACF2 to generate a
//*                   formatted report of the data set access.
//*  STEP4:           Creates PDI Findings from data set checks
//*
//*  ===> NOTE:  STEP3 AND STEP4 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
//DELETE1  DD DSN=&SRRHLQ..TEMP4,
//           UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//DELETE2  DD DSN=&SRRHLQ..AUACCESS,
//           UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//DELETE3  DD DSN=&SRRHLQ..SENSITVE.RPT,
//           UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//DELETE4  DD DSN=&SRRHLQ..RESOURCE,
//           UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//*
//STEP2     EXEC PGM=ACFRPTSL
//SYSPRINT  DD DSN=&SRRHLQ..TEMP4(LIDS),
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(RECFM=VBA,LRECL=256,BLKSIZE=27930,DSORG=PO),
//             SPACE=(CYL,(50,25,50)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//SYSIN DD *
REPORT(SHORT)
INPUT(ACF2)
NOUPDATE
DTCFIELD(NO)
SFLDS(UID)
/*
//STEP3     EXEC PGM=ACFBATCH
//*PRODUCES OUTPUT RESOURCE
//*
//SYSPRINT  DD DSN=&SRRHLQ..RESOURCE,
//             DISP=(,CATLG,DELETE),
//             DCB=(DSORG=PS,RECFM=VBA,LRECL=133,BLKSIZE=27930),
//             SPACE=(CYL,(20,10)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//SYSIN     DD *
 SET RESOURCE(***)
 SET VERBOSE
 LIST LIKE(-)
 END
/*
//STEP4     EXEC  EXAMRPTS,
//             CNTL=&SRRHLQ..CNTL
//CNTL      DD DSN=&SRRHLQ..TABLE,
//             DISP=SHR
//          DD DSN=&SRRHLQ..CNTL,
//             DISP=SHR
//TEMP3     DD DSN=&SRRHLQ..TEMP3,
//             DISP=SHR
//TEMP4     DD DSN=&SRRHLQ..TEMP4,
//             DISP=OLD
//RESOURCE  DD DSN=&SRRHLQ..RESOURCE,
//             DISP=OLD
//REPORT    DD DSN=&SRRHLQ..SENSITVE.RPT,
//             DISP=(NEW,CATLG,DELETE),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1),
//             SPACE=(CYL,(50,10,30)),
//             DCB=(RECFM=FB,LRECL=133,BLKSIZE=27930,DSORG=PO)
//SYSPRINT  DD DSN=&&TEMP,
//             DISP=(NEW,DELETE,DELETE),
//             DCB=(RECFM=VB,LRECL=255,BLKSIZE=27998,DSORG=PS),
//             SPACE=(CYL,(15,15)),
//             UNIT=(SYSDA,1)
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0001 TERMMSGS(ON))
  ISPSTART CMD(%CAAC0101 TERMMSGS(ON))
/*
//STEP5     EXEC  EXAMRPTS,
//             CNTL=&SRRHLQ..CNTL
//CNTL      DD DSN=&SRRHLQ..TABLE,
//             DISP=SHR
//          DD DSN=&SRRHLQ..CNTL,
//             DISP=SHR
//TEMP4     DD DSN=&SRRHLQ..TEMP4,
//             DISP=OLD
//PDIDD     DD DSN=&SRRHLQ..PDI,
//             DISP=OLD
//DIALOG    DD DSN=&DIALOG,
//             DISP=SHR
//AUACCESS  DD DSN=&SRRHLQ..AUACCESS,
//             DISP=(NEW,CATLG,DELETE),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=SYSDA,
//             SPACE=(TRK,(60,35,35)),
//             DCB=(RECFM=FB,LRECL=32,BLKSIZE=27968,DSORG=PO)
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0420 TERMMSGS(ON))
  ISPSTART CMD(%CAAC0120 TERMMSGS(ON))
/*
//
