/* REXX */
/* CLS2REXXed by FSOX001 on 6 May 2016 at 09:52:32  */
/*trace r?*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"             /* CACM000A EDIT MACRO .PDI(?????) */
/*********************************************************************/
/* 04/01/2004 JL Nelson changed to display No Finding text           */
/* 06/15/2004 JL Nelson ADDED EXIT CODE                              */
/* 08/26/2004 JL Nelson ADDED code for AAMV0030 findings             */
/* 08/27/2004 JL Nelson ADDED text for N/A PDI's                     */
/* 09/22/2004 JL Nelson Added parameter to turn member error msg off */
/* 02/07/2005 JL Nelson Correct FIND/CHANGE to avoid problems        */
/* 02/11/2005 JL Nelson Changed constants to variables before rename */
/* 03/02/2005 JL Nelson ADDED code for AAMV0325 LPA findings         */
/* 06/03/2005 JL Nelson Changed STIG requirement to DISA             */
/*            recommendation.                                        */
/* 06/09/2005 JL Nelson Pass MAXCC in ZISPFRC variable               */
/* 04/17/2006 JL Nelson Use NRSTR avoid abend 900 if ampersand in    */
/*            data.                                                  */
/* 05/05/2006 JL Nelson Fix RC 20 on ISREDIT LINE when " or ' in     */
/*            data.                                                  */
/* 03/05/2007 CL Fenton Added process for logical parmlibs.          */
/* 06/18/2007 C Stern Added code for AAMV0370.                       */
/* 10/19/2007 C Stern Added code for ZUSS0011.                       */
/* 02/01/2008 C Stern Added code for ZUSS0012.                       */
/* 09/22/2009 CL Fenton Modified code in testing and added for       */
/*            AAMV0380.                                              */
/* 09/12/2011 CL Fenton Modified code in testing and added for       */
/*            ACP00291.                                              */
/* 05/06/2016 CL Fenton Converted script from CLIST to REXX.         */
/* 05/16/2018 CL Fenton Added "Not Reviewed" as a status indicator   */
/*            for ZUSS0012 MOUNT SETUID and NOSECURITY errors,       */
/*            STS-019875.                                            */
/* 01/29/2021 CL Fenton Added automation for addition SMFPRMxx       */
/*            vuls, STS-025825, STS-025826, and STS-025827.          */
/* 05/24/2021 CL Fenton Added automation for addition CLOCKxx        */
/*            vul, STS-026251.  Added error processing.              */
/* 04/22/2022 CL Fenton Added automation for addition IGDSMSxx       */
/*            vul, STS-028325.                                       */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CACM000A 04/22/22"
sysprompt = "OFF"                /* CONTROL NOPROMPT          */
sysflush = "OFF"                /* CONTROL NOFLUSH           */
sysasis = "ON"                 /* CONTROL ASIS - caps off   */
return_code = 0
maxcc = 0
/* *************************************** */
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* SYMLIST                                 */
/* TERMMSGS                                */
/* MBRPREF                                 */
/* *************************************** */
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
"NUMBER OFF"
"CAPS OFF"
"STATS OFF"
return_code = 0
Address ISPEXEC "VGET (CONSLIST COMLIST SYMLIST TERMMSGS MEMBER" ,
  "PARMDSN PDINAME MBRPREF MBRZFND MBRMSG) ASIS"
 
If return_code <> 0 then do
  Say pgmname "VGET RC =" return_code zerrsm
  Say pgmname "CONSLIST/"conslist "COMLIST/"comlist "SYMLIST/"symlist ,
    "TERMMSGS/"termmsgs
  Say pgmname "MEMBER/"member "PDINAME/"pdiname "MBRPREF/"mbrpref ,
    "MBRZFND/"mbrzfnd "MBRMSG/"mbrmsg
  end
cm0avget = return_code
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" ,
  then Trace r
 
/* *************************************** */
/* MAIN PROCESS                            */
/* *************************************** */
MAIN:
"FIND 'Not a Finding' FIRST"
If return_code = 0 then,
  "DELETE ALL NX"
aca = ""
mbrpref8 = substr(mbrpref"00      ",1,8)
return_code = 0
"(LASTLINE) = LINENUM .ZLAST"
/* Empty member - First time in EDIT */
If return_code > 0 then do
  If member = " " then do
    "LINE_AFTER .ZLAST = DATALINE 'Not a Finding'"
    "LINE_AFTER .ZLAST = DATALINE ' '"
    SIGNAL END_FIRST
    end
  Select
    When pdiname = "AAMV0020" then do
      aca = "The following improperly named IEAAPFxx and/or PROGxx",
        "member(s) was (were) found for which no documentation was",
        "provided to substantiate the variance(s):"
      end
    When pdiname = "AAMV0030" then do
      aca = "The following IEASYSxx member(s) contain(s) the",
        "LNKAUTH=LNKLST specification:"
      end
    When pdiname = "AAMV0040" then do
      aca = "The following inaccessible APF-authorized library(ies)",
        "exists (exist) on this system:"
      End
    When pdiname = "AAMV0080" then do
      aca = "The following improperly named IKJTSOxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      End
    When pdiname = "AAMV0130" then do
      aca = "The following improperly named SCHEDxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      end
    When pdiname = "AAMV0200" then do
      aca = "The following improperly named IEASVCxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      end
    When pdiname = "AAMV0240" then do
      aca = "The following improperly named IEAAPPxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      end
    When pdiname = "AAMV0320" then do
      aca = "The following improperly named LPA member(s) was (were)",
        "found for which no documentation was provided to substantiate",
        "the variance(s):"
      end
    When pdiname = "AAMV0325" then do
      aca = "The following non-existent or inaccessible LPA library(ies)",
        "was (were) found:"
      end
    When pdiname = "AAMV0340" then do
      aca = "The following improperly named LNKLSTxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      end
    When pdiname = "AAMV0350" then do
      aca = "The following non-existent or inaccessible LINKLIST",
        "library(ies) was (were) found:"
      end
    When pdiname = "AAMV0360" then do
      aca = "The following improperly named SMFPRMxx member(s) was",
        "(were) found for which no documentation was provided to",
        "substantiate the variance(s):"
      end
    When left(pdiname,7) = "AAMV037" then do
      aca = "The following non-standard SMF data collection option(s)",
        "is (are) specified:"
      end
    When pdiname = "AAMV0380" then do
      aca = "The following SMF record type(s) is (are) not collected",
        "for this system:"
      end
    When pdiname = "ACP00291" then do
      aca = "The following MCS console(s) is (are) improperly defined",
        "within parmlib concatenation:"
      end
    When pdiname = "ZUSS0011" then do
      aca = "The OMVS parameter is improperly specified within PARMLIB",
        "member IEASYSxx."
      end
    When pdiname = "ZUSS0012" then do
      aca = "The BPXPRMxx member(s) is (are) improperly specified",
        "within PARMLIB."
      end
    When pdiname = "AAMV0070" then do
      aca = "The ACCURACY in CLOCKxx member(s) is (are) improperly",
        "specified within PARMLIB."
      end
    When pdiname = "ZSMS0032" then do
      aca = "The keywords in IGDSMSxx member(s) is (are) improperly",
        "specified within PARMLIB."
      end
    end
  "LINE_AFTER .ZLAST = (ACA)"
  "LINE_AFTER .ZLAST = DATALINE ' '"
  return_code = 0
  end
END_FIRST:
return_code = 0
If member = " " then do
  If mbrpref <> 999999 & mbrmsg <> "OFF" then do
    ac = "     "mbrpref8"  "mbrzfnd
    "LINE_AFTER .ZLAST = (AC)"
    end
/*!*/SIGNAL  VGET_MESSAGE
  end
If pdiname = "AAMV0030" | pdiname = "ZUSS0011" then ,
  SIGNAL VGET_MESSAGE
If mbrmsg <> "OFF" then ,
  ac = "     "parmdsn"("member") Member in error"
else
  ac = "     "parmdsn"("member")"
ACCESS_NAMES:
return_code = 0
"FIND FIRST '"parmdsn"("member")' 6"
If return_code > 0 then do
  If aca = " " then do
    "LINE_AFTER .ZLAST = DATALINE ' '"
    end
  "LINE_AFTER .ZLAST = (AC)"
  end
VGET_MESSAGE:
return_code = 0
Address ISPEXEC "VGET (AC) ASIS"
ac = ac
if ac = "Not Reviewed" then do
  Call Not_Reviewed
  end
Else do
  If ac <> " " then do
    If member = " " then ,
      "LINE_AFTER .ZLAST = DATALINE ' '"
    "LINE_AFTER .ZLAST = (AC)"
    end
  end
If ac = " " & pdiname = "ZUSS0012" then do
  "LINE_AFTER .ZLAST = DATALINE ' '"
  end
/*"(LASTLINE) = LINENUM .ZLAST"
do x = 1 to lastline
  "(DATA) = LINE" x
  say "DATA:"data
  end*/
 
/* *************************************** */
/* END PROCESSES                           */
/* *************************************** */
END_EXIT:
return_code = 0
ERR_EXIT:
zispfrc = 0
Address ISPEXEC "VPUT (ZISPFRC) SHARED"
cm00arc = return_code
/*Say pgmname "ZISPFRC =" zispfrc*/
Address ISPEXEC "VPUT (CM0AVGET CM00ARC) ASIS"
"END"
Exit 0
 
 
Not_Reviewed:
"FIND FIRST '"ac"'"
If return_code = 4 then do
  "LINE_BEFORE .ZFIRST = (AC)"
  end
Return
 
 
NoValue:
Failure:
Syntax:
say pgmname 'REXX error' rc 'in line' sigl':' strip(ERRORTEXT(rc))
say SOURCELINE(sigl)
SIGNAL ERR_EXIT
 
 
Error:
return_code = RC
if RC > 4 & RC <> 8 then do
  say pgmname "LASTCC =" RC strip(zerrlm)
  say pgmname 'REXX error' rc 'in line' sigl':' ERRORTEXT(rc)
  say SOURCELINE(sigl)
  end
if return_code > maxcc then
  maxcc = return_code
return
 
 
