/* REXX */
/* CLS2REXXed by FSOX001 on 11 Aug 2017 at 16:03:01  */
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
 
/*********************************************************************/
/* Was SY$SRRGR populate ACF2 authorized user groups                 */
/*                                                                   */
/* 10/17/2005 JL.NELSON Remove dummy records.                        */
/* 10/18/2005 JL.NELSON ACF2 ver 7 does not exist, changed select.   */
/* 10/27/2005 JL.Nelson added program name to panel for diagnostics. */
/* 10/27/2005 JL.Nelson Changed ACF2 options to match TSS/RACF.      */
/* 10/27/2005 JL.Nelson Fixed abend in browse of empty ACF2SREC.     */
/* 11/07/2005 JL.Nelson Removed populate code, done in batch.        */
/* 11/08/2005 JL.NELSON Re-did data set checks with error panel.     */
/* 11/10/2005 JL.NELSON Added option to list Authorized user.        */
/* 01/13/2006 C. Stern Commented out ACF2 panel selection.           */
/* 08/14/2017 CL.FENTON Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "SRR$AUGR 08/14/17"
pgm8 = substr(pgmname,1,8)
JOBINST  = "CACJ051D"            /* BATCH Install job for dialog     */
SRRPAUGR = "SRRPAUGR"            /* Authorize User Group panel       */
DATASUF  = "DATA"                /* Data file suffix                 */
/***********************************************/
/* CONSLIST = CONLIST                          */
/* COMLIST = LIST                              */
/* TERMPRO = PROMPT                            */
/* TERMMSGS = MESSAGES                         */
/* TRACE TURNS ON MESSAGING                    */
/***********************************************/
 
Address ISPEXEC
"VGET (CONSLIST COMLIST SYMLIST TERMMSGS) ASIS"
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" then,
  Trace r
 
syssymlist = symlist          /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist         /* CONTROL CONLIST/NOCONLIST */
syslist = comlist             /* CONTROL LIST/NOLIST       */
sysmsg = termmsgs             /* CONTROL MSG/NOMSG         */
sysprompt = "OFF"             /* CONTROL NOPROMPT          */
sysflush = "OFF"              /* CONTROL NOFLUSH           */
sysasis = "ON"                /* CONTROL ASIS - caps off   */
return_code = 0
"VGET (SRRUSER ACPNAME ZTRAIL) ASIS"
return_code = 0
datadsn = srruser"."datasuf
x = listdsi("'"datadsn"'")
If sysreason <> 0 then do
  srrerr = "Dataset" datasuf "is missing, batch job" jobinst ,
    "must be ran to create the file."
  srrerc = sysreason
  zerrlm = datadsn
  srrmsg1 = sysmsglvl1
  srrmsg2 = sysmsglvl2
  "DISPLAY PANEL(SRRPERR)"
/*SIGNAL  ERR_EXIT*/
  end
Else Do until return_code > 0
  zcmd = " "
  opt = " "
  return_code = 0
  srrmsg = " "
  if ztrail = "" then,
    "DISPLAY PANEL("srrpaugr")"
  else do
    zcmd = ztrail
    parse var zcmd opt '.' ztrail
    if index("ABC",opt) = 0 then,
      "DISPLAY PANEL("srrpaugr") MSG(ISPG211)"
    end
  "VPUT (ZTRAIL) ASIS"
  If return_code = 8 then leave
  If return_code > 4 then do
    Say pgmname "DISPLAY RC =" return_code zerrmsg zerrsm
    leave
    end
  return_code = 0
  Select
    When opt = "A" then,
      "SELECT CMD(%SRR$BRWU)"
    When opt = "B" then,
      "SELECT CMD(%SRR$POP)"
    When opt = "C" then do
      srrmsg = "Please wait, locating all members may take",
        "a few minutes."
      "CONTROL DISPLAY LOCK"
      "DISPLAY PANEL("srrpaugr")"
      "SELECT CMD(SRR$USR)"
      end
    end
  end
/*******************************************/
/* CLIST EXIT                              */
/*******************************************/
ERR_EXIT:
Exit
 
 
NoValue:
Failure:
Syntax:
say pgmname 'REXX error' rc 'in line' sigl':' strip(ERRORTEXT(rc))
say SOURCELINE(sigl)
Exit
 
 
Error:
return_code = RC
return
 
 
