/* REXX */
/*                                       */
/* AUTHOR: Charles Fenton                */
/*                                       */
/*********************************************************************/
/* DISPLAY SYSTEM INFORMATION ON TERMINAL                            */
/*********************************************************************/
/*********************************************************************/
/* This Edit macro to add additional dataset resources to CACT0000   */
/*********************************************************************/
/* Change summary:                                                   */
/* 05/26/2009 CL Fenton Initial creation of script to replace        */
/*            CACM042T and CACM042V.                                 */
/* 10/09/2009 CL Fenton Added SRRAUDT, ROSCOE, TDMF, VSS, and        */
/*            VTAM collection analysis.  Chgd identifier order       */
/*            on several other product reports.                      */
/* 02/12/2010 CL Fenton Added analysis of GLOBRPT under TSS,         */
/*            PDI TSS1010.  Added additional information for         */
/*            CLSUPER, TDMF, and VSS.                                */
/* 02/26/2010 CL Fenton chgd paragraph name and interpret call       */
/*            statements.                                            */
/* 03/18/2010 CL Fenton chgd collection for ROSCOE. Added            */
/*            collection FDR, NETVIEW, and TADZ.                     */
/* 06/10/2010 CL Fenton chgd identifiers for TADZ and STCs           */
/*            access.  Added PCSPAUDT to CA1RPT.  Added              */
/*            SECBAUDT to ZSRR0000 and ZSRR0002 and added            */
/*            AUTOAUDT to ZSRR0002.                                  */
/* 07/19/2010 CL Fenton Added collection for HCD and ICSF.           */
/* 10/08/2010 CL Fenton Moved end for do loop for NetView.           */
/* 06/17/2011 CL Fenton Chgd UPDATE to ALTER for ADTUSER             */
/*            accesses, CSD-AR002718448.  Chgd TAPEAUDT access       */
/*            to ALTER for CA1RPT, CSD-AR002704634.                  */
/* 06/26/2011 CL Fenton Added collection for BMCMVZ, CSSMTP,         */
/*            and VTAPE.                                             */
/* 09/12/2011 CL Fenton Added collection for SDSF,                   */
/*            CSD-AR002893724.                                       */
/* 12/13/2011 CL Fenton Added collection changes for to              */
/*            separate products CA1, NC-PASS, and SDSF into          */
/*            independent STIGs and added CA Common Services         */
/*            (CCS) for collection, CSD-AR003079950.                 */
/* 12/21/2011 CL Fenton Chgd VTAPE, ZVTA0001 by adding TAPEAUDT      */
/*            access ALTER, CSD-AR003006639.                         */
/* 04/17/2012 CL Fenton Added * access READ to CTDRPT, CTMRPT,       */
/*            CTORPT, CTRRPT, and IOARPT, CSD-AR003377486,           */
/*            CSD-AR003377547, CSD-AR003377548,                      */
/*            CSD-AR003377549, and CSD-AR003377551.  Also made       */
/*            same change to TDMFRPT.                                */
/* 06/14/2012 CL Fenton Added addition Product collection for        */
/*            Abend-AID and Health Checker, CSD-AR003400260.         */
/* 08/22/2012 CL Fenton Chgd ZCTM0002 and ZCTM0003 to reflect        */
/*            requested access and removed * access READ for         */
/*            INCONTROL Zxxx0000 vuls, CSD-AR002744994,              */
/*            CSD-AR002744989, and CSD-AR002997643.                  */
/* 12/06/2012 CL Fenton Chgd ZCTO0001 to add PCSPAUDT with           */
/*            access READ, STS-000760.  Added addition Product       */
/*            collection for CAMIM, STS-001238.                      */
/* 02/12/2013 CL Fenton Chgd ZHCK0001 replacing Health Check         */
/*            STCs access UPDATE with ALTER, STS-001917.             */
/* 06/12/2013 CL Fenton Chgd all Product Datasets to                 */
/*            Installation Datasets.  Added Product collection       */
/*            for CAMICS, STS-002882.                                */
/* 08/21/2013 CL Fenton Chgd TSS1010 adding access for               */
/*            DASBAUDT, DASDAUDT, AUDTAUDT, and VTAPE STC/Batch      */
/*            users, STS-003016.                                     */
/* 12/10/2013 CL Fenton Chgd ZSRR0000 adding access for              */
/*            PCSPAUDT, STS-004312.                                  */
/* 01/06/2014 CL Fenton Chgd ZCTD0002 UPDATE for BMC STCs to         */
/*            ALTER, STS-003825.                                     */
/* 03/10/2014 CL Fenton Chgd ZCTD0001 UPDATE for BMC STCs to         */
/*            ALTER, STS-004798.                                     */
/* 03/10/2014 CL Fenton Chgd ZMIC0000 READ for MICSADM to            */
/*            ALTER, STS-005213.                                     */
/* 05/04/2015 CL Fenton Removed DBMS and IDMS from automation,       */
/*            STS-007213 and STS-007637.                             */
/* 05/13/2015 CL Fenton Added OPERAUDT READ access to CTOSTC         */
/*            datasets, STS-009502.                                  */
/* 08/19/2015 CL Fenton Added ZAID0002 for AbendAID User             */
/*            datasets, STS-011534.                                  */
/* 08/21/2015 CL Fenton Added BMCUSER/READ and BMCADMIN/UPDATE       */
/*            for ZIOA0001, STS-010534.                              */
/* 08/24/2015 CL Fenton Added BMCUSER and BMCADMIN access READ       */
/*            for ZCTR0002, STS-010497.                              */
/* 11/10/2015 CL Fenton Added collection information for the         */
/*            RACF REXX security exit, STS-011660.                   */
/* 01/22/2016 CL Fenton Added AUTOAUDT READ access to TADZSTC        */
/*            datasets, STS-013092.                                  */
/* 04/19/2016 CL Fenton Added SMFBAUDT ALTER access to MICSUSER      */
/*            datasets, STS-014145.                                  */
/* 08/11/2016 CL Fenton Changed initial value TBLMBR and             */
/*            changed how information is loaded into TBLMBR and      */
/*            TBLSTC.                                                */
/* 10/26/2016 CL Fenton Added requirements CA1 Started Tasks         */
/*            dataset, STS-015909.                                   */
/* 07/21/2017 CL Fenton Added requirements CSSMTP Started Tasks      */
/*            dataset, STS-017966.                                   */
/* 07/07/2020 CL Fenton Added requirement to ADTUSER allowing        */
/*            all users READ access, STS-024906.                     */
/* 08/14/2020 CL Fenton Added requirement to TADZRPT allowing        */
/*            all users READ access, STS-024955.                     */
/* 01/25/2021 CL Fenton Chgs to determine if CHKPOINT DD statement   */
/*            specified in SMTP proc, also changed other similar     */
/*            process areas, STS-025549.                             */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
PGMNAME = 'CACM000T 04/12/21'
Numeric digits 10                           /* dflt of 9 not enough  */
Address ISREDIT "MACRO"
Address ISPEXEC
"VGET (CONSLIST COMLIST SYMLIST TERMPRO TERMMSGS)"
If CONSLIST = ON | COMLIST = ON | SYMLIST = ON | TRACE = ON ,
  then Trace r
"VGET (ACPNAME TYPERUN CACT0000)"
CM0TVGET = RC
Address ISREDIT
"(MEMBER) = MEMBER"
signal on syntax name error
TYPRUN=left(TYPERUN,8,"9")
/*if TYPERUN <> "FULL" then,*/
  interpret call TYPRUN
/*else
  interpret call TYPERUN*/
continue:
Address ISREDIT
/*"RESET"*/
"CURSOR = 1 0"
cnt = 0
if MEMBER = CACT0000 then do
  mbr = 'TBLMBR'
  TBLMBR = "#"
  do forever
    RC = 0
    "FIND '0' 9"
    if RC > 0 then leave
    "(DATA) = LINE .ZCSR"
    ITER  = substr(DATA,10,3)
    RPT   = substr(DATA,1,8)
    PDI   = substr(DATA,13,8)
    TITLE = substr(DATA,22)
    TITLE = strip(TITLE,"t")
    TBLMBR = TBLMBR||ITER||RPT PDI TITLE"#"
    cnt = cnt + 1
  end
  Address ISPEXEC "VPUT (TBLMBR) ASIS"
  end
else do
  mbr = 'TBLSTC'
  TBLSTC = '#'
  "(LASTLINE) = LINENUM .ZLAST"
  do x = 1 to LASTLINE
    "(DATA) = LINE" x
    if pos('*',DATA) = 1 then iterate
    TBLSTC = TBLSTC||strip(DATA)'#'
    cnt = cnt + 1
  end
  Address ISPEXEC "VPUT (TBLSTC) ASIS"
  end
CM0TVPUT = RC
say PGMNAME 'Member' MEMBER 'processed, collected' cnt ,
  'for variable' mbr'.'
CM00TRC  = RC
Address ISPEXEC "VPUT (CM0TVGET CM0TVPUT CM00TRC) ASIS"
/*********************************************************************/
/* Done looking at all control blocks                                */
/*********************************************************************/
"END"
/*if RC > 0 then,
  "CANCEL"*/
Exit 0                                       /* End CACC1001 - RC 0  */
/*********************************************************************/
/*  Start of sub-routines                                            */
/*********************************************************************/
FULL9999:
if ACPNAME = 'TSS' & MEMBER = CACT0000 then do
  Address TSO "newstack"
  queue 'GLOBRPT 0ZZ TSS1010  GLOBAL ACCESS REPORT@'
  queue 'GLOBRPT           EXECUTE '
  queue 'GLOBRPT  DASBAUDT ALTER '
  queue 'GLOBRPT  DASDAUDT ALTER '
  queue 'GLOBRPT  EMERAUDT ALTER '
  queue 'GLOBRPT  TSTCAUDT ALTER '
  queue 'GLOBRPT  AUDTAUDT READ  '
 
  say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
  Call Write_queued
  end
 
if ACPNAME = 'RACF' & MEMBER = CACT0000 then do
  Address TSO "newstack"
  queue 'RACFREXX0AJ RACF0465 RACF REXX EXIT DATASET REPORT@'
  queue 'RACFREXX          EXECUTE '
  queue 'RACFREXX SECAAUDT READ  '
  queue 'RACFREXX AUDTAUDT READ  '
  queue 'RACFREXX SYSPAUDT READ  '
  queue 'RACFREXX AXRUSER  READ  '
  queue 'RACFREXX AXR      READ  '
 
  say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
  Call Write_queued
  end
 
rectype = "1"
Call COLLECT_REC "HLTHCK"
 
Address TSO "newstack"
queue 'SYSREXX           WRITE   '
queue 'SYSREXX  *        NONE    '
queue 'SYSREXX  AUDTAUDT READ    '
queue 'SYSREXX  AXR      READ    '
queue 'SYSREXX  AXRUSER  READ    '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'SYSREXX  'userid'READ   '
end
queue 'SYSREXX  SYSPAUDT ALTER   '
queue 'SYSREXX  TSTCAUDT ALTER   '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for SYSREXX.'
Call Write_queued
 
 
FSO99999:
SRRAUDIT:
return
 
 
ABNDAID9:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'AIDUSER 0C0 ZAID0002 Compuware Abend-Aid USER Datasets@'
queue 'AIDSTC  0C4 ZAID0001 Compuware Abend-Aid STC Datasets@'
queue 'AIDRPT  0C5 ZAID0000 Compuware Abend-Aid Installation Datasets@'
queue 'AIDRPT            WRITE '
queue 'AIDRPT   *        READ  '
queue 'AIDRPT   AUDTAUDT READ  '
queue 'AIDRPT   SYSPAUDT ALTER '
queue 'AIDRPT   TSTCAUDT ALTER '
queue 'AIDSTC   *        READ  '
queue 'AIDSTC   AUDTAUDT READ  '
queue 'AIDSTC   SYSPAUDT ALTER '
queue 'AIDSTC   TSTCAUDT ALTER '
trecs = recs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'AIDSTC   'userid'ALTER '
end
queue 'AIDUSER  *        READ  '
queue 'AIDUSER  AUDTAUDT READ  '
queue 'AIDUSER  APPDAUDT CONTROL'
queue 'AIDUSER  APPSAUDT CONTROL'
queue 'AIDUSER  SYSPAUDT ALTER '
queue 'AIDUSER  TSTCAUDT ALTER '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'AIDUSER  'userid'ALTER '
end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CAMICS99:
Address TSO "newstack"
queue 'MICSUSER0C8 ZMIC0002 CA MICS User Datasets@'
queue 'MICSRPT 0C9 ZMIC0000 CA MICS Installation Datasets@'
queue 'MICSRPT           WRITE '
queue 'MICSRPT  AUDTAUDT READ  '
queue 'MICSRPT  MICSADM  ALTER '
queue 'MICSRPT  MICSUSER READ  '
queue 'MICSRPT  SECAAUDT READ  '
queue 'MICSRPT  SYSPAUDT ALTER '
queue 'MICSRPT  TSTCAUDT ALTER '
queue 'MICSUSER AUDTAUDT READ  '
queue 'MICSUSER MICSUSER READ  '
queue 'MICSUSER SECAAUDT READ  '
queue 'MICSUSER MICSADM  ALTER '
queue 'MICSUSER SMFBAUDT ALTER '
queue 'MICSUSER SYSPAUDT ALTER '
queue 'MICSUSER TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CAMIM999:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'MIMSTC  0C6 ZMIM0001 CA MIM STC Datasets@'
queue 'MIMRPT  0C7 ZMIM0000 CA MIM Installation Datasets@'
queue 'MIMRPT            WRITE '
queue 'MIMRPT   *        READ  '
queue 'MIMRPT   AUDTAUDT READ  '
queue 'MIMRPT   SYSPAUDT ALTER '
queue 'MIMRPT   TSTCAUDT ALTER '
queue 'MIMSTC   *        READ  '
queue 'MIMSTC   AUDTAUDT READ  '
queue 'MIMSTC   SYSPAUDT ALTER '
queue 'MIMSTC   TSTCAUDT ALTER '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'MIMSTC   'userid'ALTER '
end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CAAUDTR9:
Address TSO "newstack"
queue 'ADTUSER 0CN ZADT0002 CA Auditor (CA Examine) User Datasets@'
queue 'ADTRPT  0CO ZADT0000 CA Auditor (CA Examine) Installation Datasets@'
queue 'ADTRPT            WRITE '
queue 'ADTRPT   AUDTAUDT READ  '
queue 'ADTRPT   SECAAUDT READ  '
queue 'ADTRPT   SECBAUDT READ  '
queue 'ADTRPT   SYSPAUDT ALTER '
queue 'ADTRPT   TSTCAUDT ALTER '
queue 'ADTUSER  *        READ  '
queue 'ADTUSER  AUDTAUDT ALTER '
queue 'ADTUSER  SECAAUDT ALTER '
queue 'ADTUSER  SECBAUDT ALTER '
queue 'ADTUSER  SYSPAUDT ALTER '
queue 'ADTUSER  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CATSOL99:
Address TSO "newstack"
queue 'CSLPROD 0DB ZCSL0000 Catalog Solution Installation Datasets@'
queue 'CSLPROD           WRITE '
queue 'CSLPROD  *        READ  '
queue 'CSLPROD  SYSPAUDT ALTER '
queue 'CSLPROD  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CA199999:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'CA1PROD 0DA ZCA10000 CA-1 Installation Datasets@'
queue 'CA1PROD  *        READ'
queue 'CA1PROD  SYSPAUDT ALTER'
queue 'CA1PROD  TSTCAUDT ALTER'
queue 'CA1RPT  0CJ ZCA10003 CA-1 TMC and AUDIT@'
queue 'CA1RPT            ALTER'
queue 'CA1RPT   *        NONE'
queue 'CA1RPT   APPSAUDT READ'
queue 'CA1RPT   AUDTAUDT READ'
queue 'CA1RPT   OPERAUDT READ'
queue 'CA1RPT   PCSPAUDT READ'
queue 'CA1RPT   TAPEAUDT ALTER'
queue 'CA1RPT   SYSPAUDT ALTER'
queue 'CA1RPT   TSTCAUDT ALTER'
queue 'CA1STC  0CK ZCA10001 CA-1 STC Datasets@'
queue 'CA1STC   AUDTAUDT READ'
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CA1STC   'userid'ALTER '
end
queue 'CA1STC   SYSPAUDT ALTER'
queue 'CA1STC   TSTCAUDT ALTER'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CCS99999:
Address TSO "newstack"
queue 'CCSRPT  0EA ZCCS0000 CA Common Services Installation Datasets@'
queue 'CCSRPT   *        READ'
queue 'CCSRPT   SYSPAUDT ALTER'
queue 'CCSRPT   TSTCAUDT ALTER'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CICS9999:
Address TSO "newstack"
queue 'CICSRPT 0CQ          CICS Installation Datasets@'
queue 'CICSSTC 0CA          CICS STC Datasets@'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CSSMTP99:
Address ISPEXEC "VGET (DSNS)"
if RC <> 0 then do
  "END"
  exit 0
  end
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'SMTSTC  0EB ZSMT0001 CSSMTP STC Datasets@'
queue 'SMTSTC   AUDTAUDT READ  '
queue 'SMTSTC   SYSPAUDT ALTER '
queue 'SMTSTC   TSTCAUDT ALTER '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'SMTSTC   'userid'ALTER '
end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
CLSUPER9:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'KLSRPT  0DC ZCLS0000 CL/SUPERSESSION Installation Datasets@'
queue 'KLSSTC  0CH ZCLS0001 CL/SUPERSESSION STC Datasets@'
queue 'KLSSTC   *        READ  '
queue 'KLSSTC   AUDTAUDT READ  '
queue 'KLSSTC   SECAAUDT READ  '
queue 'KLSSTC   SYSPAUDT ALTER '
queue 'KLSSTC   TSTCAUDT ALTER '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'KLSSTC   'userid'ALTER '
end
queue 'KLSRPT            WRITE '
queue 'KLSRPT   *        READ  '
queue 'KLSRPT   AUDTAUDT READ  '
queue 'KLSRPT   SECAAUDT READ  '
queue 'KLSRPT   SYSPAUDT ALTER '
queue 'KLSRPT   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
DFSMS999:
return
 
 
FDR99999:
Address TSO "newstack"
queue 'FDRRPT  0BR ZFDR0000 FDR Installation Datasets@'
queue 'FDRRPT            WRITE '
queue 'FDRRPT   *        READ  '
queue 'FDRRPT   AUDTAUDT READ  '
queue 'FDRRPT   SYSPAUDT ALTER '
queue 'FDRRPT   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
FEP99999:
Address TSO "newstack"
queue 'NCPRPT  0CB          FEP/NCP@'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
HCD99999:
Address TSO "newstack"
queue 'HCDUSER 0DL ZHCD0002 HCD User Datasets@'
queue 'HCDRPT  0DM ZHCD0000 HCD Installation Datasets@'
queue 'HCDRPT            WRITE '
queue 'HCDRPT   AUDTAUDT READ  '
queue 'HCDRPT   AUTOAUDT READ  '
queue 'HCDRPT   OPERAUDT READ  '
queue 'HCDRPT   SYSPAUDT ALTER '
queue 'HCDRPT   TSTCAUDT ALTER '
queue 'HCDUSER  AUDTAUDT READ  '
queue 'HCDUSER  AUTOAUDT ALTER '
queue 'HCDUSER  OPERAUDT ALTER '
queue 'HCDUSER  SYSPAUDT ALTER '
queue 'HCDUSER  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
HLTHCK99:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'HCKSTC  0BS ZHCK0001 IBM Health Checker STC Datasets@'
queue 'HCKSTC   AUDTAUDT READ  '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'HCKSTC   'userid'ALTER  '
end
queue 'HCKSTC   SYSPAUDT ALTER '
queue 'HCKSTC   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
ICSF9999:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'ICSFRPT 0DO ZICS0000 ICSF Installation Datasets@'
queue 'ICSFSTC 0DN ZICS0001 ICSF STC Datasets@'
queue 'ICSFRPT           WRITE '
queue 'ICSFRPT  *        READ  '
queue 'ICSFRPT  AUDTAUDT READ  '
queue 'ICSFRPT  SYSPAUDT ALTER '
queue 'ICSFRPT  TSTCAUDT ALTER '
queue 'ICSFSTC  AUDTAUDT READ  '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'ICSFSTC  'userid'ALTER '
queue 'ICSFSTC  SYSPAUDT ALTER '
queue 'ICSFSTC  TSTCAUDT ALTER '
end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCCTD99:
trecs = ""
rectype = "1"
table = 'BMCIOA BMCCTD BMCCTM BMCCTO'
do CNT = 1 to words(table)
  Call COLLECT_REC word(table,CNT)
  trecs = trecs""recs
  end
Address TSO "newstack"
queue 'CTDUSER 0DS ZCTD0002 CONTROL-D User Datasets@'
queue 'CTDSTC  0DT ZCTD0001 CONTROL-D STC Datasets@'
queue 'CTDRPT  0DU ZCTD0000 CONTROL-D Installation Datasets@'
queue 'CTDRPT            WRITE '
/*queue 'CTDRPT   *        READ  '*/
queue 'CTDRPT   AUDTAUDT READ  '
queue 'CTDRPT   BMCUSER  READ  '
queue 'CTDRPT   SECAAUDT READ  '
queue 'CTDRPT   SECDAUDT READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTDRPT   'userid'READ   '
  end
queue 'CTDRPT   SYSPAUDT ALTER '
queue 'CTDRPT   TSTCAUDT ALTER '
queue 'CTDSTC   AUDTAUDT READ  '
queue 'CTDSTC   BMCUSER  READ  '
queue 'CTDSTC   SECAAUDT UPDATE'
queue 'CTDSTC   SECDAUDT UPDATE'
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTDSTC   'userid'ALTER  '
  end
queue 'CTDSTC   SYSPAUDT ALTER '
queue 'CTDSTC   TSTCAUDT ALTER '
queue 'CTDUSER  AUDTAUDT READ  '
queue 'CTDUSER  BMCUSER  UPDATE'
queue 'CTDUSER  SECAAUDT UPDATE'
queue 'CTDUSER  SECDAUDT UPDATE'
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTDUSER  'userid'ALTER '
  end
queue 'CTDUSER  SYSPAUDT ALTER '
queue 'CTDUSER  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCCTM99:
trecs = ""
rectype = "1"
table = 'BMCIOA BMCCTD BMCCTM BMCCTO'
do CNT = 1 to words(table)
  Call COLLECT_REC word(table,CNT)
  trecs = trecs""recs
  end
Address TSO "newstack"
queue 'CTMJCL  0DV ZCTM0003 CONTROL-M User/Application JCL Datasets@'
queue 'CTMUSER 0DW ZCTM0002 CONTROL-M User Datasets@'
queue 'CTMSTC  0DX ZCTM0001 CONTROL-M STC Datasets@'
queue 'CTMRPT  0DY ZCTM0000 CONTROL-M Installation Datasets@'
queue 'CTMRPT            WRITE '
/*queue 'CTMRPT   *        READ  '*/
queue 'CTMRPT   AUDTAUDT READ  '
queue 'CTMRPT   AUTOAUDT READ  '
queue 'CTMRPT   BMCUSER  READ  '
queue 'CTMRPT   DPCSAUDT READ  '
queue 'CTMRPT   OPERAUDT READ  '
queue 'CTMRPT   PCSPAUDT READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTMRPT   'userid'READ   '
  end
queue 'CTMRPT   SYSPAUDT ALTER '
queue 'CTMRPT   TSTCAUDT ALTER '
queue 'CTMSTC   AUDTAUDT READ  '
queue 'CTMSTC   BMCUSER  READ  '
queue 'CTMSTC   AUTOAUDT UPDATE'
queue 'CTMSTC   OPERAUDT UPDATE'
queue 'CTMSTC   PCSPAUDT UPDATE'
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTMSTC   'userid'UPDATE '
  end
queue 'CTMSTC   SYSPAUDT ALTER '
queue 'CTMSTC   TSTCAUDT ALTER '
queue 'CTMUSER  AUDTAUDT READ  '
queue 'CTMUSER  BMCUSER  UPDATE'
queue 'CTMUSER  DPCSAUDT UPDATE'
queue 'CTMUSER  PCSPAUDT UPDATE'
queue 'CTMUSER  OPERAUDT UPDATE'
queue 'CTMUSER  SYSPAUDT ALTER '
queue 'CTMUSER  TSTCAUDT ALTER '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTMUSER  'userid'ALTER '
  end
queue 'CTMJCL   AUDTAUDT READ  '
queue 'CTMJCL   AUTOAUDT READ  '
queue 'CTMJCL   BMCUSER  READ  '
queue 'CTMJCL   OPERAUDT READ  '
queue 'CTMJCL   DPCSAUDT UPDATE'
queue 'CTMJCL   PCSPAUDT UPDATE'
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTMJCL   'userid'UPDATE'
  end
queue 'CTMJCL   BMCADMIN ALTER '
queue 'CTMJCL   SYSPAUDT ALTER '
queue 'CTMJCL   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCCTO99:
trecs = ""
rectype = "1"
table = 'BMCIOA BMCCTD BMCCTM BMCCTO'
do CNT = 1 to words(table)
  Call COLLECT_REC word(table,CNT)
  trecs = trecs""recs
  end
Address TSO "newstack"
queue 'CTOSTC  0D1 ZCTO0001 CONTROL-O STC Datasets@'
queue 'CTORPT  0D2 ZCTO0000 CONTROL-O Installation Datasets@'
queue 'CTORPT            WRITE '
/*queue 'CTORPT   *        READ  '*/
queue 'CTORPT   AUDTAUDT READ  '
queue 'CTORPT   BMCUSER  READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTORPT   'userid'READ   '
  end
queue 'CTORPT   SYSPAUDT ALTER '
queue 'CTORPT   TSTCAUDT ALTER '
queue 'CTOSTC   AUDTAUDT READ  '
queue 'CTOSTC   OPERAUDT READ  '
queue 'CTOSTC   PCSPAUDT READ  '
queue 'CTOSTC   BMCUSER  UPDATE'
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTOSTC   'userid'UPDATE '
  end
queue 'CTOSTC   SYSPAUDT ALTER '
queue 'CTOSTC   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCCTR99:
trecs = ""
rectype = "1"
table = 'BMCIOA BMCCTD BMCCTM BMCCTO BMCCTR'
do CNT = 1 to words(table)
  Call COLLECT_REC word(table,CNT)
  trecs = trecs""recs
  end
Address TSO "newstack"
queue 'CTRUSER 0DZ ZCTR0002 CONTROL-M/Restart User Datasets@'
queue 'CTRRPT  0D0 ZCTR0000 CONTROL-M/Restart Installation/Operations Datasets@'
queue 'CTRRPT            WRITE '
/*queue 'CTRRPT   *        READ  '*/
queue 'CTRRPT   AUDTAUDT READ  '
queue 'CTRRPT   BMCUSER  READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTRRPT   'userid'READ  '
  end
queue 'CTRRPT   SYSPAUDT ALTER '
queue 'CTRRPT   TSTCAUDT ALTER '
queue 'CTRUSER  AUDTAUDT READ  '
queue 'CTRUSER  BMCADMIN READ  '
queue 'CTRUSER  BMCUSER  READ  '
queue 'CTRUSER  AUTOAUDT ALTER '
queue 'CTRUSER  PCSPAUDT ALTER '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'CTRUSER  'userid'ALTER '
  end
queue 'CTRUSER  SYSPAUDT ALTER '
queue 'CTRUSER  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCIOA99:
trecs = ""
rectype = "1"
table = 'BMCIOA BMCCTD BMCCTM BMCCTO'
do CNT = 1 to words(table)
  Call COLLECT_REC word(table,CNT)
  trecs = trecs""recs
  end
Address TSO "newstack"
queue 'IOAUSER 0DP ZIOA0002 INCONTROL (IOA) User Datasets@'
queue 'IOASTC  0DQ ZIOA0001 INCONTROL (IOA) STC Datasets@'
queue 'IOARPT  0DR ZIOA0000 INCONTROL (IOA) Installation Datasets@'
queue 'IOARPT            WRITE '
/*queue 'IOARPT   *        READ  '*/
queue 'IOARPT   AUDTAUDT READ  '
queue 'IOARPT   BMCUSER  READ  '
queue 'IOARPT   OPERAUDT READ  '
queue 'IOARPT   PCSPAUDT READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'IOARPT   'userid'READ   '
  end
queue 'IOARPT   SYSPAUDT ALTER '
queue 'IOARPT   TSTCAUDT ALTER '
queue 'IOASTC   AUDTAUDT READ  '
queue 'IOASTC   BMCUSER  READ  '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'IOASTC   'userid'UPDATE '
  end
queue 'IOASTC   BMCADMIN UPDATE'
queue 'IOASTC   SYSPAUDT ALTER '
queue 'IOASTC   TSTCAUDT ALTER '
queue 'IOAUSER  AUDTAUDT READ  '
queue 'IOAUSER  BMCUSER  UPDATE'
queue 'IOAUSER  PCSPAUDT UPDATE'
queue 'IOAUSER  SYSPAUDT ALTER '
queue 'IOAUSER  TSTCAUDT ALTER '
recs = trecs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'IOAUSER  'userid'ALTER '
  end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
BMCMVZ99:
rectype = "1"
Call COLLECT_REC
rec_old = recs
Address TSO "newstack"
queue 'MVZSTC  0C2 ZMVZ0001 MAINVIEW STC Datasets@'
queue 'MVZRPT  0C3 ZMVZ0000 MAINVIEW Installation Datasets@'
queue 'MVZRPT            WRITE '
queue 'MVZRPT   *        READ  '
queue 'MVZRPT   AUDTAUDT READ  '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'MVZRPT   'userid'READ   '
  end
queue 'MVZRPT   SYSPAUDT ALTER '
queue 'MVZRPT   TSTCAUDT ALTER '
queue 'MVZSTC   AUDTAUDT READ  '
recs = rec_old
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'MVZSTC   'userid'ALTER '
  end
queue 'MVZSTC   SYSPAUDT ALTER '
queue 'MVZSTC   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
MQS99999:
Address TSO "newstack"
queue 'MQSRPT  0CL          WEBSPHERE MQ@'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
NCPASS99:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'NCPASRPT0DD ZNCP0000 NC-PASS Installation Datasets@'
queue 'NCPASSTC0CD ZNCP0001 NC-PASS STC Datasets@'
 
queue 'NCPASRPT          WRITE '
queue 'NCPASRPT *        READ  '
queue 'NCPASRPT AUDTAUDT READ  '
queue 'NCPASRPT SYSPAUDT ALTER '
queue 'NCPASRPT TSTCAUDT ALTER '
queue 'NCPASSTC AUDTAUDT READ  '
queue 'NCPASSTC SECAAUDT UPDATE'
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'NCPASSTC 'userid'ALTER '
  end
queue 'NCPASSTC SYSPAUDT ALTER '
queue 'NCPASSTC TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
NETVIEW9:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'NETVRPT 0CW ZNET0000 NETVIEW Installation Datasets@'
queue 'NETVSTC 0CV ZNET0001 NETVIEW STC Datasets@'
queue 'NETVRPT           WRITE '
queue 'NETVRPT  *        READ  '
queue 'NETVRPT  AUDTAUDT READ  '
queue 'NETVRPT  SYSPAUDT ALTER '
queue 'NETVRPT  TSTCAUDT ALTER '
queue 'NETVSTC  AUDTAUDT READ  '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'NETVSTC  'userid'ALTER '
  end
queue 'NETVSTC  SYSPAUDT ALTER '
queue 'NETVSTC  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
ROSCOE99:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'ROSSTC  0DG ZROS0001 CA ROSCOE STC Datasets@'
queue 'ROSRPT  0DH ZROS0000 CA ROSCOE Installation Datasets@'
queue 'ROSSTC   *        READ  '
queue 'ROSSTC   AUDTAUDT READ  '
queue 'ROSSTC   SECAAUDT READ  '
queue 'ROSSTC   SYSPAUDT ALTER '
queue 'ROSSTC   TSTCAUDT ALTER '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'ROSSTC   'userid'ALTER '
end
queue 'ROSRPT            WRITE '
queue 'ROSRPT   *        READ  '
queue 'ROSRPT   AUDTAUDT READ  '
queue 'ROSRPT   SECAAUDT READ  '
queue 'ROSRPT   SYSPAUDT ALTER '
queue 'ROSRPT   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
SDSF9999:
Address ISPEXEC "VGET (DSNS)"
if RC <> 0 then do
  "END"
  exit 0
  end
Address TSO "newstack"
queue 'ISFRPT  0CT ZISF0000 SDSF@'
queue 'ISFRPT   *        READ  '
queue 'ISFRPT   AUDTAUDT READ  '
queue 'ISFRPT   SYSPAUDT ALTER '
queue 'ISFRPT   TSTCAUDT ALTER '
if dsns <> "" then do
  queue 'SDSFRPT 0CU ZISF0002 HASPINDX@'
  queue 'SDSFRPT  *        READ  '
  queue 'SDSFRPT  AUDTAUDT READ  '
  queue 'SDSFRPT  SYSPAUDT ALTER '
  queue 'SDSFRPT  TSTCAUDT ALTER '
  end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
SRRAUDT9:
Address TSO "newstack"
queue 'SRRUSER 0DE ZSRR0002 SRRAUDIT User Datasets@'
queue 'SRRPROD 0DF ZSRR0000 SRRAUDIT Installation Datasets@'
queue 'SRRPROD           WRITE '
queue 'SRRPROD  AUDTAUDT READ  '
queue 'SRRPROD  PCSPAUDT READ  '
queue 'SRRPROD  SECAAUDT READ  '
queue 'SRRPROD  SECBAUDT READ  '
queue 'SRRPROD  SYSPAUDT ALTER '
queue 'SRRPROD  TSTCAUDT ALTER '
queue 'SRRUSER           WRITE '
queue 'SRRUSER  AUTOAUDT READ  '
queue 'SRRUSER  AUDTAUDT ALTER '
queue 'SRRUSER  SECAAUDT ALTER '
queue 'SRRUSER  SECBAUDT ALTER '
queue 'SRRUSER  SYSPAUDT ALTER '
queue 'SRRUSER  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
TADZ9999:
rectype = "1"
Call COLLECT_REC
Address TSO "newstack"
queue 'TADZRPT 0CY ZTAD0000 TADz Installation Datasets@'
queue 'TADZSTC 0CX ZTAD0001 TADz STC Datasets@'
queue 'TADZRPT           WRITE '
rec_old = recs
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'TADZRPT  'userid'READ   '
end
queue 'TADZRPT  *        READ  '
queue 'TADZRPT  AUDTAUDT READ  '
queue 'TADZRPT  AUTOAUDT READ  '
queue 'TADZRPT  SYSPAUDT ALTER '
queue 'TADZRPT  TSTCAUDT ALTER '
queue 'TADZSTC  AUDTAUDT READ  '
queue 'TADZSTC  AUTOAUDT READ  '
recs = rec_old
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'TADZSTC  'userid'ALTER  '
end
queue 'TADZSTC  SYSPAUDT ALTER '
queue 'TADZSTC  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
TDMF9999:
Address TSO "newstack"
queue 'TDMFRPT 0DI ZTDM0000 TDMF Installation Datasets@'
queue 'TDMFRPT           WRITE '
queue 'TDMFRPT  *        READ  '
queue 'TDMFRPT  AUDTAUDT READ  '
queue 'TDMFRPT  SYSPAUDT ALTER '
queue 'TDMFRPT  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
VSS99999:
Address TSO "newstack"
queue 'VSSUSER 0DJ ZVSS0002 VSS User Datasets@'
queue 'VSSRPT  0DK ZVSS0000 VSS Installation Datasets@'
queue 'VSSUSER           WRITE '
queue 'VSSUSER  AUDTAUDT ALTER '
queue 'VSSUSER  SECAAUDT ALTER '
queue 'VSSUSER  SECDAUDT ALTER '
queue 'VSSUSER  SYSPAUDT ALTER '
queue 'VSSUSER  TSTCAUDT ALTER '
queue 'VSSRPT            WRITE '
queue 'VSSRPT   AUDTAUDT READ  '
queue 'VSSRPT   SECAAUDT READ  '
queue 'VSSRPT   SECDAUDT READ  '
queue 'VSSRPT   SYSPAUDT ALTER '
queue 'VSSRPT   TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
VTAM9999:
Address TSO "newstack"
queue 'VTAMRPT 0CC ZVTM0018 VTAM@'
queue 'VTAMRPT  *        READ  '
queue 'VTAMRPT  AUDTAUDT READ  '
queue 'VTAMRPT  SYSPAUDT ALTER '
queue 'VTAMRPT  TSTCAUDT ALTER '
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
VTAPE999:
rectype = "1"
Call COLLECT_REC
rec_old = recs
Address TSO "newstack"
queue 'VTAPERPT0C1 ZVTA0000 CA VTAPE Installation Datasets@'
queue 'VTAPESTC0CZ ZVTA0001 CA VTAPE STC Datasets@'
queue 'VTAPESTC AUDTAUDT READ  '
queue 'VTAPESTC SYSPAUDT ALTER '
queue 'VTAPESTC TAPEAUDT ALTER '
queue 'VTAPESTC TSTCAUDT ALTER '
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'VTAPESTC 'userid'ALTER '
end
queue 'VTAPERPT          WRITE '
queue 'VTAPERPT *        READ  '
queue 'VTAPERPT AUDTAUDT READ  '
recs = rec_old
do until recs = ''
  parse var recs . 72 userid 81 recs
  queue 'VTAPERPT 'userid'READ  '
end
queue 'VTAPERPT SYSPAUDT ALTER '
queue 'VTAPERPT TSTCAUDT ALTER '
if ACPNAME = "TSS" then do
  recs = rec_old
  do until recs = ''
    parse var recs . 72 userid 81 recs
    queue 'GLOBRPT  'userid'READ  '
  end
  end
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
WAS99999:
Address TSO "newstack"
queue 'WEBRPT  0CS          WEBSPHERE APPL. SERVICE@'
 
say pgmname right(queued(),4) 'records written to' MEMBER 'for' TYPERUN'.'
Call Write_queued
return
 
 
Write_queued:
/*signal off error
tmsg = msg("off")*/
do queued()
  Parse pull line                            /* pull queued lines    */
  RC = 0
  "FIND '"LINE"' FIRST"
  if RC <> 0 then,
    "LINE_AFTER .ZLAST = DATALINE (LINE)"
  end /* do a = 1 */
Address TSO "delstack"
return
 
 
COLLECT_REC:
arg test
Address ISPEXEC
"lminit dataid(dialog) ddname(dialog)"
lminit_dialog = RC
"lmopen dataid("dialog")"
lmopen_dialog = RC
"lmmfind dataid("dialog") member(products)"
lmmfind_dialog = RC
if test = '' then,
  TRUN = left(TYPERUN,8)
else,
  TRUN = left(test,8)
RC = 0
recs =
do until RC>0
  "lmget dataid("dialog") mode(invar) dataloc(data) datalen(lrecl)",
    "maxlen(80)"
  if RC = 0 & ,
     pos(TRUN' 'rectype,data) = 1 then do
    recs = recs""data
    end /* if RC = 0 & */
end /* until RC>0 */
"lmclose dataid("dialog")"
lmclose_dialog = RC
"lmfree dataid("dialog")"
lmfree_dialog = RC
return
 
 
error:
say
say pgmname TYPERUN "ERRORTEXT"(rc) 'for processing' MEMBER'.'
signal continue
