/* REXX */
/* CLS2REXXed by UMLA01S on 27 Sep 2021 at 08:40:37  */
/*trace ?r*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"               /* CARM0033 EDIT MACRO */
/*********************************************************************/
/* 09/27/2021 CL Fenton Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CARM0033 09/27/21"
sysprompt = 'OFF'
syssymlist = 'OFF'
sysconlist = 'OFF'
syslist = 'OFF'
sysmsg = 'ON'
curline = 0
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"
 
/*******************************************/
/* 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"
looper = 0
 
 
LOOP:
Do forever
If curline = ender then leave
looper = looper + 1
out. = ""
return_code = 0
/*******************************************/
/* LOOK FOR CLASS                          */
/*******************************************/
"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
data = data
 
/*******************************************/
/* STRIP CLASS AND NAME                    */
/*******************************************/
class = word(data,1)
cname = word(data,2)
cname = strip(cname,"T")
 
/*******************************************/
/* LOOK FOR SUBTRANS                       */
/*******************************************/
return_code = 0
"FIND 'MEMBER 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
data = data
/*******************************************/
/* STRIP MEMBER CLASS                      */
/*******************************************/
mclass = word(data,1)
 
 
/*******************************************/
/* LOOK FOR RESOURCES                      */
/*******************************************/
RESOURCEC:
return_code = 0
"FIND 'RESOURCES IN GROUP' 1"
If return_code <> 0 then do
  If looper = 1 then,
    lastloop = "YES"
  leave
  end
 
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
lineout = 1
blank = " "
 
 
LPOPER:
Do until left(data,1) = blank
  "CURSOR =" curline 1
  "(DATA) = LINE" curline
  data = data
  If left(data,1) = blank then iterate
 
  spc = "                  "
 
  If word(data,1) = "NO" then do
    out.lineout = class left(" ",18) cname mclass"   "
    end
  Else do
    rword = word(data,1)
    rword = left(rword,18)
    cname = left(cname,15)
    out.lineout = class rword cname mclass"     "
    end
  out.0 = lineout
  curline = curline + 1
  lineout = lineout + 1
  end
 
 
/*******************************************/
/* STRIP UACC                              */
/*******************************************/
SUBTRANSDONE:
return_code = 0
"FIND 'UNIVERSAL ACCESS'"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
data = data
parse var data . 24 uacc1 . 51 warn1 52 .
/*If warn1 = "YES" then,
  warn1 = "Y"
Else,
  warn1 = "N"*/
clean = ""
cleanck = ""
cleancnt = 1
blank = " "
 
 
/*******************************************/
/* LOOK FOR AUDIT PARMS                    */
/*******************************************/
AUDIT:
return_code = 0
"FIND 'AUDITING' 1"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
data = data
/*******************************************/
/* SET AUDIT 1 = AUDIT PARMS               */
/*******************************************/
 
audit1 = substr(data,1,50)
audit1 = strip(data,"T")
/*******************************************/
/* LOOK FOR WHO IS USING DATASET           */
/*******************************************/
return_code = 0
"FIND 'USER' 1"
"(CURLINE) = LINENUM .ZCSR"
curline = curline + 2
"CURSOR =" curline 1
"(DATA) = LINE" curline
data = data
blank = " "
word = word(data,1)
acc4 = word(data,2)
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" "
  Do linec = out.0 to 1 by -1
    ab = out.linec
    ac = substr(ab,1,60) outline
    ac = substr(ac,1,84) uacc1
    ac = substr(ac,1,93) audit1
    ac = substr(ac,1,132)""acc5
    Address ISPEXEC "LMPUT DATAID("temp4") MODE(INVAR) DATALOC(AC)",
      "DATALEN("length(ac)") MEMBER("omember")"
    end
  end
 
 
/*NEXT:
word = blank
curline = curline + 1
"CURSOR =" curline 1
"(DATA) = LINE" curline
data = data
If substr(data,1,1) <> blank then do
  loopcnt = 22
  counter = 1
  wordcnt = 0
  idcnt = idcnt + 1
  letter = substr(data,counter,1)
  linec = lineout
  linec = linec - 1
  SIGNAL ID_CHECK
  end
 
If substr(data,1,1) = blank then do
  linec = lineout
  linec = linec - 1
  Do until linec = 0
    ab = out.linec
    ac = substr(ab,1,60) outline
    ac = substr(ac,1,84) uacc1
    ac = substr(ac,1,93) audit1
    ac = substr(ac,1,132)""acc5
    Address ISPEXEC "LMPUT DATAID("temp4") MODE(INVAR) DATALOC(AC)",
      "DATALEN("length(ac)") MEMBER("omember")"
    linec = linec - 1
    end
  end*/
 
If lastloop = "YES" then leave
/*SIGNAL END_EDIT*/
end
/*end*/
 
 
END_EDIT:
If lastloop = "NO" then,
  Address ISPEXEC "LMMREP DATAID("temp4") MEMBER("omember")"
 
 
/*******************************************/
/* SAVE OUTPUT                             */
/*******************************************/
END_IT:
END_EDIT2:
"CANCEL"
Exit
 
 
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
 
 
