//CAAJ043R JOB (ACCOUNT),'FSO / SRR MVS AUDIT',
//             CLASS=A,MSGCLASS=X,USER=SRRAUDT
//*
//* Change the above jobcard to a valid jobcard.
//*
// SET SRRINST=SYS2.SRRAUDIT                  INSTALL LIBRARIES
// SET SRRUSER=SYS3.SRRAUDIT                  USER LIBRARIES
//*
// SET SRRJ=CAAJ043R
// SET SRRJ1=CACJ041E
// SET CACJ=CACJ043E                CA-EXAMINE REPORTS JOB
// SET PDIJ=CACJ041R                GLOBAL OPTIONS REPORT JOB
// SET CNTL=&SRRINST..CNTL
// SET DIALOG=&SRRUSER..DATA
//PROCLIB JCLLIB ORDER=(&SRRUSER..CNTL,&CNTL)
//*
//*********************************************************************
//*                      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.
//*
//*  JS030:  Reads TEMP3 (DSNLIST data set collection)
//*          and queries ACF2 to generate a
//*          formatted report of the data set access.
//*
//*  ===> NOTE:  JS030 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.
//*********************************************************************
//*
//JS010   EXEC PGM=IEFBR14
//AUACCESS  DD DSN=&SRRUSER..&SRRJ..AUACCESS,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//LISTCMDS  DD DSN=&SRRUSER..&SRRJ..LISTCMDS,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//LISTUSER  DD DSN=&SRRUSER..&SRRJ..LISTUSER,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//RESOURCE  DD DSN=&SRRUSER..&SRRJ..RESOURCE,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//SENSITVE  DD DSN=&SRRUSER..&SRRJ..SENSITVE.RPT,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//SHOWCMAP  DD DSN=&SRRUSER..&SRRJ..SHOWCMAP,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//SHOWSYS   DD DSN=&SRRUSER..&SRRJ..SHOWSYS,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//TEMP4     DD DSN=&SRRUSER..&SRRJ..TEMP4,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//TEMP9     DD DSN=&SRRUSER..&SRRJ..TEMP9,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//USERLIST  DD DSN=&SRRUSER..&SRRJ..USERLIST,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//*
//JS020   EXEC PGM=ACFRPTSL
//SYSPRINT  DD DSN=&SRRUSER..&SRRJ..TEMP4(LIDS),
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(RECFM=VBA,LRECL=255,BLKSIZE=27998,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)
/*
//*
//  IF (RC=0 AND JS020.RUN=TRUE) THEN
//JS030   EXEC PGM=ACFBATCH
//*PRODUCES OUTPUT RESOURCE
//*
//SYSPRINT  DD DSN=&SRRUSER..&SRRJ..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
/*
//  ENDIF
//*
//  IF (RC=0 AND JS030.RUN=TRUE) THEN
//JS040   EXEC EXAMRPTS,
//             CNTL=&CNTL
//CNTL      DD DISP=SHR,DSN=&SRRUSER..&SRRJ1..TABLE
//          DD DISP=SHR,DSN=&CNTL
//TEMP3     DD DISP=SHR,DSN=&SRRUSER..&CACJ..TEMP3
//TEMP4     DD DSN=&SRRUSER..&SRRJ..TEMP4,
//             DISP=OLD
//RESOURCE  DD DSN=&SRRUSER..&SRRJ..RESOURCE,
//             DISP=OLD
//REPORT    DD DSN=&SRRUSER..&SRRJ..SENSITVE.RPT,
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(RECFM=FB,LRECL=133,BLKSIZE=27930,DSORG=PO),
//             SPACE=(TRK,(50,25,30)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//SYSPRINT  DD DSN=&SRRUSER..&SRRJ..TEMP5,
//             DISP=(NEW,DELETE,DELETE),
//             DCB=(RECFM=VB,LRECL=255,BLKSIZE=27998,DSORG=PS),
//             SPACE=(TRK,(15,15)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0001 TERMMSGS(ON))
  ISPSTART CMD(%CAAC0101 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS040.PSTEP020.RUN=TRUE) THEN
//JS050  EXEC  EXAMRPTS,
//             CNTL=&CNTL
//CNTL      DD DISP=SHR,DSN=&SRRUSER..&SRRJ1..TABLE
//          DD DISP=SHR,DSN=&CNTL
//TEMP4     DD DSN=&SRRUSER..&SRRJ..TEMP4,
//             DISP=OLD
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//DIALOG    DD DISP=SHR,DSN=&DIALOG
//AUACCESS  DD DSN=&SRRUSER..&SRRJ..AUACCESS,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(45,15,30)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             DCB=(RECFM=FB,LRECL=32,BLKSIZE=27968,DSORG=PO)
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0420 TERMMSGS(ON))
  ISPSTART CMD(%CAAC0120 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS050.PSTEP020.RUN=TRUE) THEN
//JS060   EXEC EXAMRPTS,
//             CNTL=&CNTL
//CNTL      DD DSN=&CNTL,
//             DISP=SHR
//TEMPS     DD DSN=&SRRUSER..&SRRJ..SHOWCMAP,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(15,15)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             DCB=(RECFM=FB,LRECL=160,BLKSIZE=1600,DSORG=PS)
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0503 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS060.PSTEP020.RUN=TRUE) THEN
//JS070   EXEC EXAMRPTS,
//             CNTL=&CNTL
//CNTL      DD DSN=&CNTL,
//             DISP=SHR
//TEMP9     DD DSN=&SRRUSER..&SRRJ..TEMP9,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(15,15)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             DCB=(RECFM=FB,LRECL=160,BLKSIZE=1600,DSORG=PS)
//DIALOG    DD DISP=SHR,DSN=&DIALOG
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0003 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS070.PSTEP020.RUN=TRUE) THEN
//JS080   EXEC EXAMRPTS,
//             CNTL=&CNTL
//CNTL      DD DSN=&CNTL,
//             DISP=SHR
//TEMPS     DD DSN=&SRRUSER..&SRRJ..SHOWSYS,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(15,15)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             DCB=(RECFM=FB,LRECL=160,BLKSIZE=1600,DSORG=PS)
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0004 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS080.PSTEP020.RUN=TRUE) THEN
//JS090     EXEC EXAMRPTS,
//             CNTL=&CNTL
//SYSTSPRT  DD DSN=&SRRUSER..&SRRJ..LISTCMDS,
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(DSORG=PS,RECFM=VB,LRECL=137,BLKSIZE=27920),
//             SPACE=(TRK,(150,150),RLSE),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//SYSTSIN   DD *
  ISPSTART CMD(%CACC041A TERMMSG(ON) RACFLIST('LISTUSER * TSO')
/*
//  ENDIF
//*
//  IF (RC=0 AND JS090.PSTEP020.RUN=TRUE) THEN
//JS100     EXEC EXAMRPTS,
//             CNTL=&CNTL
//LISTCMDS  DD DSN=&SRRUSER..&SRRJ..LISTCMDS,
//             DISP=SHR
//LISTUSER  DD DSN=&SRRUSER..&SRRJ..LISTUSER,
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(DSORG=PS,RECFM=FB,LRECL=137,BLKSIZE=13700),
//             SPACE=(TRK,(150,150),RLSE),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1)
//DATA     DD DISP=(NEW,DELETE,DELETE),
//*           DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//            UNIT=(SYSDA,1),
//            SPACE=(TRK,(90,45,90),,CONTIG),
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=13680),
//            DSN=&SRRUSER..&SRRJ..SRRDATA
//SYSTSIN   DD *
  ISPSTART CMD(%CACC0501)
/*
//  ENDIF
//*
//  IF (RC=0 AND JS100.PSTEP020.RUN=TRUE) THEN
//JS110     EXEC EXAMRPTS,
//             CNTL=&CNTL
//USERREPT  DD DISP=SHR,
//             DSN=&SRRUSER..&SRRJ..LISTUSER
//USERLIST  DD DISP=(NEW,CATLG,DELETE),
//             DCB=(DSORG=PS,RECFM=VB,LRECL=600),
//             SPACE=(TRK,(150,50),RLSE),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1),
//             DSN=&SRRUSER..&SRRJ..USERLIST
//DIALOG    DD DISP=SHR,DSN=&DIALOG
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0527 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS110.PSTEP020.RUN=TRUE) THEN
//JS120     EXEC EXAMRPTS,
//             CNTL=&CNTL
//ACF2CMDS  DD DISP=(NEW,CATLG,DELETE),
//             DCB=(DSORG=PO,RECFM=VBA,LRECL=137,BLKSIZE=27930),
//             SPACE=(TRK,(10,10,10)),
//*            DATACLAS=ALLOCX1V,   <--- Use if SMS rule applies
//             UNIT=(SYSDA,1),
//             DSN=&SRRUSER..&SRRJ..ACF2CMDS.RPT
//DIALOG    DD DISP=SHR,DSN=&DIALOG
//PDIDD     DD DISP=OLD,DSN=&SRRUSER..&PDIJ..PDI
//SYSIN     DD DISP=(NEW,DELETE),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=27930),
//             SPACE=(TRK,(1,1)),
//             UNIT=SYSDA,
//             DSN=&&ACFDATA
//SYSTSIN   DD *
  ISPSTART CMD(%CAAC0005 TERMMSGS(ON))
/*
//  ENDIF
//*
//  IF (RC=0 AND JS120.PSTEP020.RUN=TRUE) THEN
//JS999     EXEC PGM=IEFBR14
//LISTCMDS  DD DSN=&SRRUSER..&SRRJ..LISTCMDS,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//LISTUSER  DD DSN=&SRRUSER..&SRRJ..LISTUSER,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//RESOURCE  DD DSN=&SRRUSER..&SRRJ..RESOURCE,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//SHOWCMAP  DD DSN=&SRRUSER..&SRRJ..SHOWCMAP,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//SHOWSYS   DD DSN=&SRRUSER..&SRRJ..SHOWSYS,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//TEMP4     DD DSN=&SRRUSER..&SRRJ..TEMP4,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//TEMP9     DD DSN=&SRRUSER..&SRRJ..TEMP9,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//USERLIST  DD DSN=&SRRUSER..&SRRJ..USERLIST,
//             UNIT=SYSDA,DISP=(MOD,DELETE),SPACE=(TRK,0)
//*
//  ENDIF
//
