/* REXX */
/* CLS2REXXed by FSOX001 on 3 Oct 2016 at 16:20:10  */
/*trace r?*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"  /* CACM0008 EDIT PARMLIB(IEAAPF* IEASYS* LNKLST* LPALST*) */
/*********************************************************************/
/* 06/15/2004 JL Nelson ADDED EXIT CODE                              */
/* 08/26/2004 JL Nelson ADDED code for AAMV0030 findings             */
/* 08/30/2004 JL Nelson ADDED PDIERROR for return condition          */
/* 08/30/2004 JL Nelson ADDED change all for &symbolics              */
/* 12/23/2004 JL Nelson IKJ79075I System variable SYSSYMDEF failed   */
/*            RC=8.                                                  */
/* 01/25/2005 JL Nelson Ignore comments in PARMLIB                   */
/* 02/11/2005 JL Nelson Changed constants to variables before rename */
/* 03/09/2005 JL Nelson Changed LMMREP to LMMADD/LMMREP to avoid     */
/*            errors.                                                */
/* 06/09/2005 JL Nelson Pass MAXCC in ZISPFRC variable               */
/* 06/15/2005 JL Nelson Set return code to end job step              */
/* 06/16/2005 JL Nelson Changed to display the real LISTDSI error    */
/*            msg.                                                   */
/* 06/16/2005 JL Nelson Modified to test sysreason for LISTDSI       */
/*            command.                                               */
/* 06/23/2005 JL Nelson Verified for IEAAPF data-set-name volser,    */
/* 06/23/2005 JL Nelson Modified for LNKLST data-set-name(volser),   */
/* 06/23/2005 JL Nelson Modified for LPALST data-set-name(volser),   */
/* 09/26/2005 JL Nelson SYSSYMDEF check to end with a period or ")"  */
/* 10/17/2005 JL Nelson IKJ79075I SYSSYMDEF rc=8 maxcc=624 length    */
/*            gt 8.                                                  */
/* 10/18/2005 JL Nelson Added code to debug syssymdef errors         */
/* 03/06/2006 JL Nelson Made changes to avoid SUBSTR abend 920/932.  */
/* 03/09/2006 JL Nelson Set/test RCode for every ISPEXEC command.    */
/* 03/20/2006 JL Nelson Use NRSTR avoid abend 900 if ampersand in    */
/*            data.                                                  */
/* 03/29/2006 JL Nelson Test for empty member LINENUM Rcode = 4.     */
/* 04/11/2006 JL Nelson Replace & with ? if varible length > 8.      */
/* 05/09/2006 JL Nelson Avoid RC 20 on ISREDIT LINE when " or ' in   */
/*            data.                                                  */
/* 03/05/2007 CL Fenton Added process for logical parmlibs.          */
/* 10/30/2007 C Stern Added process for PDI ZUSS0011.                */
/* 02/01/2008 C Stern Added process for PDI ZUSS0012.                */
/* 03/17/2008 C Stern Corrected 932 error for lower case ROOT.       */
/* 09/22/2009 CL Fenton Added REMOVE_COMMENTS to remove comments     */
/*            from various member.  Modification made remove         */
/*            comment logic from other parts of this member.         */
/* 04/26/2011 CL Fenton Corrected symbolic change by changing both   */
/*            %&NAME.. and %&NAME to &NAME2.                         */
/* 09/12/2011 CL Fenton Added collection for CONSOLxx members for    */
/*            ACP00291, CSD-AR002893724.                             */
/* 09/16/2011 CL Fenton Chgd COMMA_COMMENTS to remove comments on    */
/*            last entry and comments after non comma record.        */
/* 01/04/2012 CL Fenton Chgd statement for CONSOLxx evaluation to    */
/*            not specify a blank &AUTH.                             */
/* 03/08/2012 CL Fenton Corrected collection of DEFAULT statement    */
/*            in CONSOLxx members, CSD-AR003389043.                  */
/* 12/20/2012 CL Fenton Corrected removal of comments that do not    */
/*            have the ending comment indicator.                     */
/* 06/03/2014 CL Fenton Corrected SYSCONS requirements for CONSOLxx  */
/*            members, STS-006105.                                   */
/* 10/21/2016 CL Fenton Converted script from CLIST to REXX.         */
/* 10/23/2017 CL Fenton Removed sequence numbers from members.       */
/* 05/16/2018 CL Fenton Added "Not Reviewed" as a status indicator   */
/*            for ZUSS0012 MOUNT SETUID and NOSECURITY errors,       */
/*            STS-019875.  Also prevented IKJ56709I from being       */
/*            displayed when the LISTDSI function is issued.         */
/* 08/10/2018 CL Fenton Chgd ACP00291 to specify that CONSOLxx       */
/*            containing multiple AUTH(MASTER) entries as not a      */
/*            finding, STS-020378.                                   */
/* 10/05/2018 CL Fenton Initialized bcr for when COMMA_COMMENTS is   */
/*            called where no commas are in members, STS-020789.     */
/* 02/05/2021 CL Fenton Commented out translate command.             */
/* 05/19/2021 CL Fenton Added automation for addition CLOCKxx        */
/*            vul, STS-026251.                                       */
/* 04/22/2022 CL Fenton Added automation for addition IGDSMSxx       */
/*            vul, STS-028325.                                       */
/* 08/07/2023 CL Fenton Corrected automation for addition IGDSMSxx,   */
/*            ACF2-SM-000060, RACF-SM-000050, and TSS0-SM-000040     */
/*            for ZSMS0032, SCTASK0045679.                           */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname   = "CACM0008 08/07/23"
sysprompt = "OFF"                /* CONTROL NOPROMPT          */
sysflush  = "OFF"                /* CONTROL NOFLUSH           */
sysasis   = "ON"                 /* CONTROL ASIS - caps off   */
/*******************************************/
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* SYMLIST                                 */
/* TERMMSGS                                */
/*******************************************/
 
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
return_code = 0
Address ISPEXEC "VGET (CONSLIST COMLIST SYMLIST TERMMSGS MBRMSG",
  "CACM040A TEMP8 MBRPREF PARMDSN PDIDD PDINAME RESVOL",
  "CATVOL) ASIS"
cm08vget = return_code
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 "MBRMSG/"mbrmsg "CACM040A/"cacm040a,
    "TEMP8/"temp8 "MBRPREF/"mbrpref
  Say pgmname "PDIDD/"pdidd "PDINAME/"pdiname,
    "RESVOL/"resvol "CATVOL/"catvol
  return_code = return_code + 16
  SIGNAL ERR_EXIT
  end
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" ,
  then Trace r
 
maxcc       = 0
return_code = 0
/*******************************************/
/* TURN ON MESSAGES                        */
/*******************************************/
syssymlist = symlist          /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist         /* CONTROL CONLIST/NOCONLIST */
syslist    = comlist          /* CONTROL LIST/NOLIST       */
sysmsg     = termmsgs         /* CONTROL MSG/NOMSG         */
/*******************************************/
/* MAIN PROCESS                            */
/*******************************************/
"NUMBER = OFF"
"AUTONUM = OFF"
"CHANGE ALL P'=' ' ' 73 80"
"(MEMBER) = MEMBER"
"(DSNAME) = DATASET"
Call remove_comments
return_code = 0
"(LASTLINE) = LINENUM .ZLAST"
If return_code > 0 then do
  If lastline = 0 then,
    Say pgmname "Empty file RCode =" return_code "DSN="dsname,
      "MEMBER="member zerrsm
  Else,
    Say pgmname "LINENUM Error RCode =" return_code "DSN="dsname
      "MEMBER="member zerrsm
  SIGNAL ERR_EXIT
  end
dataset = parmdsn"("member")"
comment_return_code     = "N"
startup_proc_switch     = "N"
stepliblist_switch      = "N"
superuser_switch        = "N"
ttygroup_switch         = "N"
useridaliastable_switch = "N"
root_setuid_switch      = "N"
root_nosetuid_switch    = "N"
mount_setuid_switch     = "N"
mount_nosetuid_switch   = "N"
mount_security_switch   = "N"
mount_nosecurity_switch = "N"
mount_security_check    = "N"
mount_test              = "N"
find_rc                 = 8
finding_switch          = "N"
blank1                  = " "
blankline               = "N"
nosecurity_sw           = "N"
lp                      = "("
rp                      = ")"
spc                     = "          "
spc50                   = spc||spc||spc||spc||spc
modify                  = ""
 
row = 1
col = 0
PRE_LOOP:
"CHANGE ALL X'50' X'6C'"         /* CHANGE ALL '&' '%' */
do forever
  return_code = 0
  "CURSOR =" row col
  "FIND X'6C'"     /* FIND '%' */
 
  If return_code > 0 then leave
 
  "(ROW,COL) = CURSOR"
  "(DATA) = LINE" row
  strt = col + 1
  endx = length(data)
  end1 = pos(" ",data,col)-1
 
  parse var data =(strt) temp .
  If temp = "" then iterate
 
  x = pos(".",temp)
  If x > 2 then
    parse var temp temp "."
  x = pos(",",temp)
  If x > 2 then,
    parse var temp temp ","
  x = pos("'",temp)
  If x > 2 then,
    parse var temp temp "'"
  x = pos('"',temp)
  If x > 2 then
    parse var temp temp '"'
  x = pos("%",temp)
  If x > 2 then
    parse var temp temp "%"
  x = pos(lp,temp)
  If x > 2 then
    parse var temp temp (lp) .
  x = pos(rp,temp)
  If x > 2 then
    parse var temp temp (rp) .
  If temp <> "" then do
    name = strip(temp,"b")
    return_code = 0
    save_maxcc = maxcc
    name2 = mvsvar('SYMDEF',name)
    If return_code > 4 then do
      Say pgmname member "NAME =" name "DATA =" data
      maxcc = save_maxcc
      end
    If return_code = 0 & name2 <> " " then do
      "CHANGE ALL '%"name".' '"name2"'"
      "CHANGE ALL '%"name"' '"name2"'"
      end
    end
  end
"CHANGE ALL X'6C' X'50'"         /* CHANGE ALL '%' '&' */
NEXT_1:
return_code = 0
 
Select
  When mbrpref = "LNKLST" then do
    mbrtyp = "LINKLIST"
    Call LNKLPA_CHECK
    end
  When mbrpref = "IEASYS" then,
    Call IEASYS_CHECK
  When mbrpref = "BPXPRM" then,
    Call BPXPRM_CHECK
  When mbrpref = "CONSOL" then,
    Call CONSOL_CHECK
  When mbrpref = "CLOCK" then,
    Call CLOCK_CHECK
  When mbrpref = "IGDSMS" then,
    Call IGDSMS_CHECK
  Otherwise do
    mbrtyp = "LPA"
    Call LNKLPA_CHECK
    end
  end
/* Below is temp until above changed to Calls. */
/*SIGNAL  END_EDIT*/
 
 
/*******************************************/
/* END PROCESSES                           */
/*******************************************/
END_EDIT:
return_code = 0
If modify <> "YES" then,
  SIGNAL  END_EXIT
return_code = 0
Address ISPEXEC "LMMADD DATAID("temp8") MEMBER("member")"
If return_code = 4 then do
  return_code = 0
  Address ISPEXEC "LMMREP DATAID("temp8") MEMBER("member")"
  If return_code <> 0 then do
    Say pgmname "LMMREP_TEMP8_RCODE =" return_code member zerrsm
    end
  end
Else do
  If return_code <> 0 then,
    Say pgmname "LMMADD_TEMP8_RCODE =" return_code member zerrsm
  end
 
END_EXIT:
return_code = 0
 
ERR_EXIT:
If maxcc > 16 | return_code > 0 then do
  Address ISPEXEC "VGET (ZISPFRC) SHARED"
  If maxcc > zispfrc then
    zispfrc = maxcc
  Else
    zispfrc = return_code
  Address ISPEXEC "VPUT (ZISPFRC) SHARED"
  Say pgmname "ZISPFRC =" zispfrc
  end
cm008rc = return_code
Address ISPEXEC "VPUT (CM08VGET CM008RC) ASIS"
"END"
Exit 0
 
 
IEASYS_CHECK:
If pdiname = "ZUSS0011" then,
  Call CHECK_ZUSS0011
Else,
  Call CHECK_AAMV0030
Return
 
 
CHECK_AAMV0030:
return_code = 0
"FIND 'LNKAUTH=LNKLST' NX ALL"
If return_code = 0 then do
  ac = "     "parmdsn"("member") - LNKAUTH=LNKLST found."
  modify = ""
  pdierror = 8
  Call EDIT_PDI
  return 0
  end
return_code = 0
"FIND 'LNKAUTH=APFTAB' NX ALL"
If return_code > 0 & member = "IEASYS00" then do
  ac = "     "parmdsn"("member") - LNKAUTH=APFTAB not found,",
    "default LNKAUTH=LNKLST is used."
  modify = ""
  pdierror = 8
  Call EDIT_PDI
  end
Return
 
 
CHECK_ZUSS0011:
return_code = 0
"FIND 'OMVS=DEFAULT' FIRST"
If return_code = 0 then do
  ac = "     "parmdsn"("member") - OMVS=DEFAULT parameter is",
    "specified."
  modify = ""
  pdierror = 8
  Call EDIT_PDI
  end
return_code = 0
"FIND 'OMVS=' FIRST"
If return_code > 0 & member = "IEASYS00" then do
  ac = "     "parmdsn"("member") - OMVS parameter is not specified,",
    "default OMVS=DEFAULT assumed."
  modify = ""
  pdierror = 8
  Call EDIT_PDI
  end
Return
 
 
LNKLPA_CHECK:
Address TSO "PROFILE NOPREFIX"
If resvol <> " " then,
  "CHANGE ' ******' ' "resvol"' ALL"
If catvol <> " " then,
  "CHANGE ' *MCAT*' ' "catvol"' ALL"
 
MAIN:
do counter = 1 to lastline
  return_code = 0
  "(DATA) = LINE" counter
  If substr(data,1,1) = "*" then iterate
  If data = " " then iterate
  data    = strip(data,"b")
  dataset = strip(data,"t",",")
  return_code = 0
  vol = " "
  If pos(" ",dataset) > 0 then do
    data1 = dataset
    parse var data1 dataset vol
    If vol = " " then do
      vol = "      "
      SIGNAL  LIST_DATA
      end
    vol = strip(vol,"l")
    end
 
LIST_DATA:
  return_code = 0
  If pos("/",dataset) > 0 then iterate
  x1 = pos(lp,dataset)
  If x1 > 0 then,
    parse var dataset dataset (lp) vol (rp) .
  msg = msg('OFF')
  If vol <> " " then,
    lst = listdsi("'"dataset"'" "VOLUME("vol")")
  Else,
    lst = listdsi("'"dataset"'")
  msg = msg(msg)
  If sysreason = 0 then iterate
  vol = left(vol,6)
  dataset = left(dataset,44)
  If mbrmsg = "ON" then,
    Say pgmname member "Dsn="dataset "Vol="vol "Sr="sysreason
  reason = sysmsglvl2
  If sysreason = 1 & pos("&",dataset) > 0 then do
    reason = "IKJ58401I INVALID DATASET NAME, SYMDEF not defined",
      "or is invalid"
    end
  If sysreason = 24 & vol <> " " then
      reason = "IKJ58424I DATA SET NOT FOUND ON VOLUME" vol
  If sysreason > 0 then do
    If modify <> "YES" then do
      If mbrpref = "IEAAPF" then do
        ac = "The following inaccessible APF-authorized library(ies)",
          "exist on this system:)"
        return_code = 0
        Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
          "DATALEN("length(ac)") MEMBER("member")"
        If return_code <> 0 then do
          Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsmm
          return_code = return_code + 16
          SIGNAL ERR_EXIT
          end
        end
      Else do
        ac = "The following non-existent or inaccessible" mbrtyp,
          "library(ies) were found:"
        return_code = 0
        Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
          "DATALEN("length(ac)") MEMBER("member")"
        If return_code <> 0 then do
          Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
          return_code = return_code + 16
          SIGNAL ERR_EXIT
          end
        end
      ac = " "
      return_code = 0
      Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
        "DATALEN("length(ac)") MEMBER("member")"
      If return_code <> 0 then do
        Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
        return_code = return_code + 16
        SIGNAL ERR_EXIT
        end
      ac = "     "parmdsn"("member")"
      return_code = 0
      Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
        "DATALEN("length(ac)") MEMBER("member")"
      If return_code <> 0 then do
        Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
        return_code = return_code + 16
        SIGNAL ERR_EXIT
        end
      end
    ac = "          "dataset vol reason
    return_code = 0
    Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
      "DATALEN("length(ac)") MEMBER("member")"
    If return_code <> 0 then do
      Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
      return_code = return_code + 16
      SIGNAL ERR_EXIT
      end
    modify = "YES"
    pdierror = 8
    Call EDIT_PDI
    end
  end
Return
 
 
/* ZUSS0012 */
BPXPRM_CHECK:
return_code = 0
"(LASTLINE) = LINENUM .ZLAST"
FIND_STARTUP:
return_code = 0
"FIND 'STARTUP_PROC(' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  parse var data . "STARTUP_PROC(" i ")" .
  x2 = "STARTUP_PROC("i")"
  If "OMVS" <> i then do
    startup_proc_switch = "Y"
    finding_switch = "Y"
    end
  end
 
FIND_STEPLIBLIST:
return_code = 0
"FIND 'STEPLIBLIST(' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  parse var data . "STEPLIBLIST(" i ")" .
  x3 = "STEPLIBLIST("i")"
  If "'/etc/steplib'" <> i then do
    stepliblist_switch = "Y"
    finding_switch = "Y"
    end
  end
 
FIND_SUPERUSER:
return_code = 0
"FIND 'SUPERUSER(' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  parse var data . "SUPERUSER(" i ")" .
  x4 = "SUPERUSER("i")"
  If "BPXROOT" <> i then do
    superuser_switch = "Y"
    finding_switch = "Y"
    end
  end
 
FIND_TTYGROUP:
return_code = 0
"FIND 'TTYGROUP(' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  parse var data . "TTYGROUP(" i ")" .
  x5 = "TTYGROUP("i")"
  If "TTY" <> i then do
    ttygroup_switch = "Y"
    finding_switch = "Y"
    end
  end
 
FIND_USERIDALIASTABLE:
return_code = 0
"FIND 'USERIDALIASTABLE(' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  parse var data . "USERIDALIASTABLE(" i ")" .
  x6 = "USERIDALIASTABLE("i")"
  useridaliastable_switch = "Y"
  finding_switch = "Y"
  end
 
ZUSS0012_PDI1:
If startup_proc_switch = "Y" then do
  ac = "          The STARTUP_PROC statement does not specify",
    "OMVS:" x2
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
If stepliblist_switch = "Y" then do
  ac = "          The STEPLIBLIST statement is improperly",
    "specified:" x3
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
If superuser_switch = "Y" then do
  ac = "          The SUPERUSER statement does not specify",
    "BPXROOT:" x4
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
If ttygroup_switch = "Y" then do
  ac = "          The TTYGROUP statement does not specify TTY:" x5
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
If useridaliastable_switch = "Y" then do
  ac = "          The USERIDALIASTABLE statement is specified:" x6
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
 
FIND_ROOT:
return_code = 0
w = 0
y = 0
z = 0
"FIND 'ROOT ' FIRST"
If return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  "(DATA) = LINE" row
  data = data
/*data = translate(data)*/
  data = data
  x7 = strip(data,"b")
 
CHECK_FOR_ROOT_SETUID:
  do row = row to lastline until wordpos("MOUNT ",data) = 1
    "(DATA) = LINE" row
    If pos("NOSETUID",data) > 0 then do
      root_nosetuid_switch = "Y"
      finding_switch = "Y"
      Call REPORT_ROOT_SETUID
      leave
      end
    end
  end
 
FIND_MOUNT:
return_code = 0
w = 0
y = 0
z = 0
If wordpos("MOUNT ",data) > 1 | row = lastline then Return 0
mount_setuid_switch     = "N"
mount_nosetuid_switch   = "N"
mount_security_switch   = "N"
mount_nosecurity_switch = "N"
mount_security_check    = "N"
mount_row               = 0
x8                      = " "
 
FIND_MOUNT_AGAIN:
do row = row to lastline
  "(DATA) = LINE" row
  If wordpos("MOUNT ",data) = 1 then do
    if mount_row > 0 then do
      Call ZUSS0012_PDI3
      mount_setuid_switch     = "N"
      mount_nosetuid_switch   = "N"
      mount_security_switch   = "N"
      mount_nosecurity_switch = "N"
      mount_security_check    = "N"
      end
    Else,
      mount_row = row
/*  data = translate(data)*/
    data = data
    x8 = strip(data,"b")
    end
  If pos(" NOSETUID ",data) > 0 then do
    mount_nosetuid_switch   = "Y"
    end
  If pos(" SETUID ",data) > 0 then do
    mount_setuid_switch     = "Y"
    finding_switch          = "Y"
    end
  If pos(" SECURITY ",data) > 0 then do
    mount_security_switch   = "Y"
    end
  If pos(" NOSECURITY ",data) > 0 then do
    mount_nosecurity_switch = "Y"
    finding_switch          = "Y"
    end
  end
if row > lastline & x8 <> " " then,
  Call ZUSS0012_PDI3
 
If mbrpref = "BPXPRM" & finding_switch = "N" then do
  pdierror = 0
  Address ISPEXEC "VPUT (PDIERROR) ASIS"
  end
 
Return 0
 
 
ZUSS0012_PDI3:
If mount_nosetuid_switch = "N" &,
  mount_nosecurity_switch = "N" &,
  mount_setuid_switch = "N" &,
  mount_security_switch = "N" then do
  If mount_test <> "Y" then do
    ac = "          The MOUNT statement(s) do(es) not specify",
      "NOSETUID and SECURITY parameters."
    pdierror = 8
    mount_test = "Y"
    Call EDIT_PDI
    ac = " "
    Call EDIT_PDI
    ac = "Not Reviewed"
    Call EDIT_PDI
    end
  ac = "             "x8
  pdierror = 8
  Call EDIT_PDI
  ac = " "
  Call EDIT_PDI
  end
If mount_setuid_switch = "Y" |,
  mount_nosecurity_switch = "Y" then do
  If mount_test <> "Y" then do
    ac = "          The MOUNT statement(s) specifies SETUID and/or",
      "NOSECURITY parameter without documentation to substantiate the",
      "variance."
    pdierror = 8
    mount_test = "Y"
    Call EDIT_PDI
    ac = " "
    Call EDIT_PDI
    end
    ac = "             "x8
    pdierror = 8
    Call EDIT_PDI
    ac = "Not Reviewed"
    Call EDIT_PDI
  end
If mount_setuid_switch = "Y" then do
  blankline = "Y"
  ac = "                SETUID"
  pdierror = 8
  Call EDIT_PDI
  end
If mount_nosecurity_switch = "Y" then do
  blankline = "Y"
  ac = "                NOSECURITY"
  pdierror = 8
  Call EDIT_PDI
  end
If blankline = "Y" then do
  ac = " "
  Call EDIT_PDI
  blankline = "N"
  end
Return
 
 
/* ACP00291 */
CONSOL_CHECK:
return_code = 0
logon_sw = ""
row = 0
console_data = ""
console_sw = ""
finding_sw = ""
mstr_sw = "N"
"(LASTLINE) = LINENUM .ZLAST"
return_code = 0
default_data = ""
"FIND 'DEFAULT ' FIRST"
If return_code = 4 then do
  logon_sw = "M"  /* missing */
  end
if return_code = 0 then do
  "(ROW) = LINENUM .ZCSR"
  end
 
PROCESS_DEFAULT:
do row = row to lastline
  "(DATA) = LINE" row
  If wordpos("CONSOLE",data) = 1 | wordpos("INIT",data) = 1 |,
    wordpos("HARDCOPY",data) = 1 then leave
  default_data = default_data""strip(data,"t")"#"
  end
y1 = pos("LOGON(",default_data)
If y1 = 0 then,
  x2 = ""
Else,
  parse var default_data "LOGON(" x2 ")"
If x2 <> "REQUIRED" & x2 <> "AUTO" then do
  if x2 <> " " then,
    logon_sw = "X"
  finding_switch = "Y"
  end
 
PROCESS_LOGON:
If logon_sw <> " " then do
  ac = "          The LOGON(REQUIRED) or LOGON(AUTO) parameter is",
    "not specified in DEFAULT statement."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
return_code = 0
"FIND ' AUTH(MASTER)' ALL"
If return_code = 0 then do
  "(A,B) = FIND_COUNTS"
  If a > 1 then,
    mstr_sw = "Y"
  end
 
PROCESS_CONSOLES:
return_code = 0
do row = 1 to lastline
  "(DATA) = LINE" row
  return_code = 0
  w = 0
  y = 0
  z = 0
  If wordpos("CONSOLE",data) = 1 then do
    If console_data <> " " then,
      Call process_console
    console_data = strip(data,"b")"#"
    console_sw = "X"
    end
  Else
    If console_sw = "X" then,
      console_data = console_data""strip(data,"t")"#"
end
Call process_console
/*If mstr_sw = "Y" then do
  member = " "
  ac = "Not Reviewed"
  Address ISPEXEC "VPUT (AC PDIERROR MEMBER) ASIS"
  Address ISPEXEC "EDIT DATAID("pdidd") MACRO("cacm040a")",
    "MEMBER("pdiname")"
  ac = "NOTE: Each site should be able to determine the system"
  ac = ac" consoles.  Please provide documentation for each"
  ac = ac" system console."
  Address ISPEXEC "VPUT (AC PDIERROR MEMBER) ASIS"
  Address ISPEXEC "EDIT DATAID("pdidd") MACRO("cacm040a")",
    "MEMBER("pdiname")"
  end*/
Return 0
 
 
/* AAMV0070 */
CLOCK_CHECK:
return_code = 0
logon_sw = ""
row = 0
clock_data = ""
clock_sw = ""
finding_sw = ""
mstr_sw = "N"
"(LASTLINE) = LINENUM .ZLAST"
lastline = lastline
return_code = 0
default_data = ""
"FIND 'ACCURACY ' FIRST"
If return_code = 4 then do
  ac = "          ACCURACY is not specified."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  return 0
  end
 
"(ROW) = LINENUM .ZCSR"
"(DATA) = LINE" row
data = data
wordacc = wordpos("ACCURACY",data)
num = word(data,wordacc+1)
If num = 1000 then do
  ac = " "
  pdierror = 0
  tmbr = member
  member = " "
  Address ISPEXEC "VPUT (MEMBER) ASIS"
  Call EDIT_PDI
  member = tmbr
  Address ISPEXEC "VPUT (MEMBER) ASIS"
  end
Else do
  ac = "          ACCURACY" num "specified."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
  end
 
Return 0
 
 
/* ZSMS0032 */
IGDSMS_CHECK:
return_code = 0
"FIND 'SMS ' FIRST"
If return_code = 4 then do
  ac = "          SMS is not specified."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
/*return 0*/
  end
 
return_code = 0
"FIND 'ACDS(' FIRST"
If return_code = 4 then do
  ac = "          ACDS is not specified."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
/*return 0*/
  end
 
return_code = 0
"FIND 'COMMDS(' FIRST"
If return_code = 4 then do
  ac = "          COMMDS is not specified."
  Call put_it
  pdierror = 8
  Call EDIT_PDI
/*return 0*/
  end
 
Return 0
 
 
/*******************************************/
/*  SYSCALL SUBROUTINES                    */
/*******************************************/
REMOVE_COMMENTS:
sp = "          "
sp = sp||sp||sp||sp||sp||sp||sp" "
"CURSOR = 1 0"
If mbrpref <> "BPXPRM" & mbrpref <> "IEAFIX" & mbrpref <> "PROG" &,
  mbrpref <> "CONSOL" & mbrpref <> "SMFPRM" & mbrpref <> "CLOCK" &,
  mbrpref <> "IGDSMS" then do
  call COMMA_COMMENTS
  return
  end
bc = "/*"
ec = "*/"
 
do forever
  return_code = 0
  "FIND '"bc"'"
  If return_code > 0 then leave
  "(BCR,BCL) = CURSOR"
  "(DATA) = LINE .ZCSR"
  "FIND '"ec"' .ZCSR .ZLAST"
  If return_code = 0 then do
    "(ECR,ECL) = CURSOR"
    If bcr < ecr then do
      parse var data data (bc)
      "LINE" bcr "= (DATA)"
      Do X = bcr+1 to ecr-1
        "LINE" x "= ' '"
        End
      "(DATA) = LINE" ecr
      parse var data . (ec) data
      "LINE" ecr "= (DATA)"
      end
    Else do
      ecl = pos(ec,data)
      parse var data b (bc) . (ec) e
      data = b e
      "LINE .ZCSR = (DATA)"
      end
    end
  Else do
    parse var data data (bc) .
    "LINE" bcr "= (DATA)"
    end
  "CURSOR =" bcr 0
  end
Call REMOVE_END
Return
 
 
COMMA_COMMENTS:
"(LASTLINE) = LINENUM .ZLAST"
bcr = 0
do forever
  return_code = 0
  "FIND ', '"
  If return_code > 0 then leave
  "(BCR,BCL) = CURSOR"
  "(DATA) = LINE .ZCSR"
  parse var data data .
  data = strip(data,"B")
  "LINE" bcr "= (DATA)"
  "CURSOR =" bcr 72
  end
bcr = bcr + 1
If bcr > lastline then,
  Return
"(DATA) = LINE" bcr
parse var data data .
data = strip(data,"B")
"LINE" bcr "= (DATA)"
bcr = bcr + 1
If bcr <= lastline then,
  "DELETE" bcr lastline
Return
 
 
REMOVE_END:
"EXCLUDE ALL '"left(' ',80)"' 1"
"EXCLUDE ALL '"sp"' 1"
"DELETE ALL X"
Return
 
 
REPORT_ROOT_SETUID:
If root_nosetuid_switch = "Y" then do
  ac = "          The ROOT statement does not specify SETUID",
    "parameter."
  pdierror = 8
  Call EDIT_PDI
  ac = "             "x7
  Call EDIT_PDI
  ac = " "
  Call EDIT_PDI
  end
Return
 
 
BLANK_LINE:
ac = " "
return_code = 0
Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
  "DATALEN("length(ac)") MEMBER("member")"
If return_code <> 0 then do
  Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
  return_code = return_code + 16
  SIGNAL  ERR_EXIT
  end
Return
 
 
PROCESS_CONSOLE:
/*"CONSOLE_DATA MSTR_SW"*/
spc = "          "
spc50 = spc||spc||spc||spc||spc
return_code = 0
If pos("SUBSYSTEM",console_data) > 0 |,
  pos("UNIT(PRT)",console_data) > 0 |,
  console_data = " " then
  Return (0)
sw1 = pos("AUTH(INFO)",console_data)
sw2 = pos("AUTH(MASTER)",console_data)
sw3 = pos("NAME(",console_data)
If sw1 > 1 & sw3 > 1 then,
  Return (0)
If mstr_sw = "N" &,
  sw1 = 0 & sw2 > 1 &,
  sw3 > 1 then,
  Return (0)
If mstr_sw = "Y" &,
  sw1 = 0 & sw2 > 1 &,
  sw3 > 1 then,
  Return (0)
If mstr_sw = "N" & pos("SYSCONS",console_data) > 0 &,
  sw1 = 0 & sw3 > 1 then,
  Return (0)
x = pos("AUTH(",console_data)
If x > 0 then do
  y = pos(rp,console_data,x)
  auth = substrc(x,y,console_data)
  end
Else,
  If pos("SYSCONS",console_data) > 1 then,
    auth = "MASTER"
  Else,
    auth = ""
x = pos("DEVNUM(",console_data)
If x > 0 then do
  y = pos(rp,console_data,x)
  devnum = substrc(x,y,console_data)
/*Say pgmname dataset
  Say pgmname devnum "specified in the following information:"*/
  tdata = console_data
/*Do until tdata = ""
    parse var tdata c "#" tdata
    Say pgmname "==>" c
    end*/
  end
Else do
/*Say pgmname dataset
  Say pgmname "DEVNUM not specified in the following information:"*/
  tdata = console_data
/*Do until tdata = ""
    parse var tdata c "#" tdata
    Say pgmname "==>" c
    end*/
  end
If sw1 = 0 & sw3 = 0 then,
  If auth = " " then,
    ac = "          "devnum" does not specify a NAME and does not",
      "specify AUTH(INFO)."
  Else,
    ac = "          "devnum" does not specify a NAME."
/*  If pos("SYSCONS",console_data) > 1 then
      ac = "          "devnum" does not specify a NAME."
    Else
      ac = "          "devnum" does not specify a NAME and does",
        "not specify AUTH(INFO)," auth "is specified."*/
Else,
  If sw3 = 0 then,
    ac = "          "devnum" does not specify a NAME."
  Else,
    If auth = " " then,
      ac = "          "devnum" does not specify AUTH(INFO"".)"
/*  Else,
      ac = "          "devnum" does not specify AUTH(INFO),",
        auth "is specified."*/
pdierror = 8
Call EDIT_PDI
Return (return_code)
 
 
EDIT_PDI:
If pdiname <> " " then do
  Address ISPEXEC "VPUT (AC PDIERROR) ASIS"
  return_code = 0
  Address ISPEXEC "EDIT DATAID("pdidd") MACRO("cacm040a")",
    "MEMBER("pdiname")"
  If return_code > 4 then do
    Say pgmname "EDIT PDI" pdiname  "RC =" return_code zerrsm
    return_code = return_code + 16
    SIGNAL  ERR_EXIT
    end
  end
Return
 
 
PUT_IT:
return_code = 0
Address ISPEXEC "LMPUT DATAID("temp8") MODE(INVAR) DATALOC(AC)",
  "DATALEN("length(ac)") MEMBER("member")"
If return_code <> 0 then do
  Say pgmname "LMPUT TEMP8" member "RC =" return_code zerrsm
  return_code = return_code + 16
  SIGNAL  ERR_EXIT
  end
Return
 
 
substrc: Procedure
 If arg(3) = '' then do
   s = Arg(1)
   l = 1
   v = arg(2)
   End
 Else do
   s = arg(1)
   l = arg(2)-arg(1)+1
   v = arg(3)
   End
 Return substr(v,s,l)
 
 
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
 
 
