/* REXX */
/* CLS2REXXed by UMLA01S on 23 Aug 2021 at 10:33:47  */
/*trace ?r*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"               /* CARM0032 EDIT MACRO */
/*********************************************************************/
/* 08/23/2021 CL Fenton Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CARM0032 08/23/21"
sysprompt = 'OFF'
syssymlist = 'OFF'
sysconlist = 'OFF'
syslist = 'OFF'
sysmsg = 'ON'
lastloop = "NO"
 
return_code = 0   /* SET RETURN CODE TO 0 */
/*******************************************/
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* TERMMSGS                                */
/*******************************************/
/* GET VARIABLES FROM POOL */
Address ISPEXEC "VGET (TEMP4 RACFRPT CONSLIST COMLIST SYMLIST",
  "ALPHA TERMMSGS) ASIS"
rm2vge = return_code
 
/*******************************************/
/* TURN ON MESSAGES                        */
/*******************************************/
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 "TEMP4/"temp4 "RACFRPT/"racfrpt "ALPHA/"alpha
  end
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" ,
  then Trace ?r
 
return_code = 0
 
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
 
"(MEMBER) = MEMBER"
omember = member
return_code = 0
 
"CHANGE ALL '&' '~'"
 
If return_code = 0 then do
  say pgmname "************************************************"
  say pgmname "* Changed & to ~ in member" member "may affect *"
  say pgmname "* results of SENSITVE.RPT member.              *"
  say pgmname "************************************************"
  end
 
 
/*******************************************/
/* MAIN LOOP                               */
/*******************************************/
CHAPRM3_MAIN:
"(ENDER) = LINENUM .ZLAST"
"CURSOR = 1 1"
curline = 0
looper = 0
 
 
LOOP:
Do forever
If curline = ender then leave
looper = looper + 1
return_code = 0
/*******************************************/
/* LOOK FOR DATASET                        */
/*******************************************/
"FIND 'CLASS      NAME' 1"
If return_code <> 0 then do
  If looper = 1 then,
    lastloop = "YES"
  leave
  end
 
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
/*******************************************/
/* STRIP CLASS AND NAME                    */
/*******************************************/
parse var data class . 12 cname .
 
 
/*******************************************/
/* STRIP UACC                              */
/*******************************************/
CLEANDONE:
return_code = 0
"FIND 'UNIVERSAL ACCESS'"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
parse var data . 22 uacc1 . 51 warn1 52 .
/*If warn1 = "Y" then,
  warn1 = "Y"
Else,
  warn1 = "N"*/
 
 
/*******************************************/
/* LOOK FOR AUDIT PARMS                    */
/*******************************************/
AUDIT:
return_code = 0
"FIND 'AUDITING' 1"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
/*******************************************/
/* SET AUDIT 1 = AUDIT PARMS               */
/*******************************************/
audit1 = substr(data,1,50)
 
/*******************************************/
/* LOOK FOR WHO IS USING DATASET           */
/*******************************************/
return_code = 0
"FIND 'USER' 1"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
If substr(data,1,1) <> " " then do
  acc5 = "Z"
  end
 
 
ID_CHECK:
Do curline = curline to ender until data = " "
  "(DATA) = LINE" curline
  If substr(data,1,1) = " " then leave
  parse var data outline1 outline2 .
  If outline1 = "NO" &,
     outline2 = "USERS" then do
    outline1 = ""
    outline2 = ""
    end
  If outline2 = "ALTER" then acc5 = "A"
  If outline2 = "CONTROL" then acc5 = "B"
  If outline2 = "UPDATE" then acc5 = "C"
  If outline2 = "READ" then acc5 = "D"
  If outline2 = "EXECUTE" then acc5 = "E"
  If outline2 = "NONE" then acc5 = "F"
  outline = left(outline1,8)" "left(outline2,8)
  outline = outline"    "warn1" "
  ac = left(class,9)""left(cname,51) outline
  ac = left(ac,84) uacc1
  ac = left(ac,93) audit1
  ac = left(ac,132)""acc5
  Address ISPEXEC "LMPUT DATAID("temp4") MODE(INVAR) DATALOC(AC)",
    "DATALEN("length(ac)") MEMBER("omember")"
  "CURSOR =" curline 1
  end
 
/*If lastloop = "YES" then,
    SIGNAL END_EDIT*/
end
 
 
END_EDIT:
If lastloop = "NO" then,
  Address ISPEXEC "LMMREP DATAID("temp4") MEMBER("omember")"
 
 
/*******************************************/
/* SAVE OUTPUT                             */
/*******************************************/
END_IT:
END_EDIT2:
"CANCEL"
Exit 0
 
 
NoValue:
Failure:
Syntax:
say pgmname 'REXX error' rc 'in line' sigl':' strip(ERRORTEXT(rc))
say SOURCELINE(sigl)
SIGNAL end_it
 
 
Error:
return_code = RC
if RC >= 16 then do
  say pgmname "LASTCC =" RC strip(zerrlm)
  say pgmname 'REXX error' rc 'in line' sigl':' strip(ERRORTEXT(rc))
  say SOURCELINE(sigl)
  end
return
 
 
