/* REXX */
/* CLS2REXXed by FSOX001 on 16 Sep 2016 at 14:54:38  */
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"               /* CACM0440 EDIT MACRO */
/*********************************************************************/
/* 08/24/2007 C. STERN Created for AAMV0440                          */
/* 02/04/2009 CL FENTON Changed ISREDIT END to ISREDIT CANCEL.       */
/*            And removed ISREDIT MEND.                              */
/* 06/28/2012 CL FENTON Minor changes made.                          */
/* 09/19/2016 CL.FENTON Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CACM0440 09/19/16"
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
/*********************************************************************/
/* This edit macro provides the finding details for AAMV0440.  It    */
/* reviews the output of the CA-EXAMINE command 6.1.1 (Files,        */
/* Integrity, Password) to determine if an OS password is being      */
/* used.  This edit macro is highly dependent on the format of the   */
/* output of the CA-EXAMINE command 6.1.1 (Files, Integrity,         */
/* Password) as saved in the file:                                   */
/* SYS3.SRRAUDIT.CACJ043E.EXAM.RPT(PASSWORD)                         */
/*********************************************************************/
/*******************************************/
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* SYMLIST                                 */
/* TERMMSGS                                */
/* PDIDD                                   */
/*******************************************/
return_code = 0
Address ISPEXEC "VGET (CONSLIST COMLIST SYMLIST TERMMSGS PDIDD) ASIS"
cm440vge = 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
  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         */
sysasis     = "ON"             /* CONTROL ASIS - caps off   */
/*******************************************/
/* MAIN PROCESS                            */
/*******************************************/
"(MEMBER) = MEMBER"
"(DSNAME) = DATASET"
pdimbr             = "AAMV0440"
row                = 0
zero               = 0
system_pwd_finding = "N"
os_pwd_finding     = "N"
Say pgmname "Processing" member "to create results for" pdimbr"."
"(LASTLINE) = LINENUM .ZLAST"
"FIND 'PASSWORD FACILITY FOUND'"
return_code = 0
"(DATA) = LINE .ZCSR"
system_count = word(data,4)
If system_count > 0 then ,
  system_pwd_finding = "Y"
CHECK_OS_PWD:
"FIND 'FILES WITH THE PASSWORD'"
"(DATA) = LINE .ZCSR"
os_count = word(data,2)
If os_count > 0 then ,
  os_pwd_finding = "Y"
 
END_PROCESS:
If system_pwd_finding = "N" & ,
   os_pwd_finding = "N" then do
  ac = "Not a Finding."
  Call put_it
  end
If system_pwd_finding = "Y" then do
  ac = "System PASSWORD data set in use."
  Call put_it
  Call blank_line
  end
If os_pwd_finding = "Y" then do
  ac = "OS password in use."
  Call put_it
  Call blank_line
  end
if system_pwd_finding = "Y" | ,
   os_pwd_finding = "Y" then do
  "FIND ""VTOC/DSCB"""
  "(ROW) = LINENUM .ZCSR"
  return_code = 0
  do row = row to lastline
    "(DATA) = LINE" row
    ac = substr(data,2)
    Call put_it
    end
  end
 
NO_FINDING:
Call add_member
 
END_IT_ALL:
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
Address ISPEXEC "VPUT (CM440VGE) ASIS"
 
"CANCEL"
Exit 0
 
 
/*******************************************/
/*  SYSCALL SUBROUTINES                    */
/*******************************************/
ADD_MEMBER:
return_code = 0
Address ISPEXEC "LMMADD DATAID("pdidd") MEMBER("pdimbr")"
If return_code = 4 then do
  return_code = 0
  Address ISPEXEC "LMMREP DATAID("pdidd") MEMBER("pdimbr")"
  If return_code <> 0 then
    Say pgmname "LMMREP_PDI_RCODE =" return_code pdimbr zerrsm
  end
Else ,
  If return_code <> 0 then ,
    Say pgmname "LMMADD_PDI_RCODE =" return_code pdimbr zerrsm
Return
 
 
BLANK_LINE:
ac = " "
Address ISPEXEC "LMPUT DATAID("pdidd") MODE(INVAR) DATALOC(AC)",
  "DATALEN("length(ac)") MEMBER("pdimbr")"
Return
 
 
PUT_IT:
Address ISPEXEC "LMPUT DATAID("pdidd") MODE(INVAR) DATALOC(AC)",
  "DATALEN("length(ac)") MEMBER("pdimbr")"
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
 
 
