/* REXX */
/* CLS2REXXed by UMLA01S on 16 Oct 2025 at 14:28:17  */
/*trace ?r*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
 
/*********************************************************************/
/* 03/01/2006 C Stern  created from caac0003 to support show clasmap */
/* 05/31/2006 C Stern  removed lmcomp for pdi data set.              */
/* 06/06/2006 C Stern  Updated ERROR ROUTINE.                        */
/* 10/16/2025 CL Fenton Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CAAC0503 10/16/25"
CONSLIST = "OFF"              /* DEFAULT IS OFF                      */
COMLIST  = "OFF"              /* DEFAULT IS OFF                      */
SYMLIST  = "OFF"              /* DEFAULT IS OFF                      */
TERMMSGS = "ON"               /* DEFAULT IS OFF                      */
TEST     = "OFF"              /* FINDING MESSAGES = OFF|MOD|FINDING  */
TRACE    = "OFF"              /* TRACE ACTIONS AND ERRORS            */
CAAM0506 = "CAAM0506"         /* PDI EDIT MACRO FOR SHOW ALL COMMAND */
CACC1000 = "CACC1000"
lminit_temps_error         = "N/A"
lminit_pdidd_error         = "N/A"
lmopen_temps_error         = "N/A"
lmclose_temps_error        = "N/A"
vput_error                 = "N/A"
edit_temps_error           = "N/A"
vget_error                 = "N/A"
am06vge                    = "N/A"
lmfree_temps_error         = "N/A"
lmfree_pdidd_error         = "N/A"
sysprompt = "OFF"             /* CONTROL NOPROMPT                    */
sysflush = "OFF"              /* CONTROL NOFLUSH                     */
sysasis = "ON"                /* CONTROL ASIS - caps off             */
Numeric digits 10             /* default of 9 not enough             */
maxcc = 0
 
Arg OPTION
do until OPTION = ""
  parse var OPTION key"("val")" OPTION
  val = strip(val,"b","'")
  val = strip(val,"b",'"')
  optcmd = key '= "'val'"'
  interpret optcmd
  end
 
return_code = 0
If trace = "ON" then do
  termmsgs = "ON"
  comlist = "ON"
  conslist = "ON"
  symlist = "ON"
  end
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" | TRACE = "ON",
  then Trace ?r
 
syssymlist = symlist                    /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist                   /* CONTROL CONLIST/NOCONLIST */
syslist = comlist                       /* CONTROL LIST/NOLIST       */
sysmsg = termmsgs                       /* CONTROL MSG/NOMSG         */
Address ISPEXEC
"CONTROL NONDISPL ENTER"
"CONTROL ERRORS RETURN"
/***********************************************/
/* CONSLIST = CONLIST                          */
/* COMLIST = LIST                              */
/* SYMLIST = SYMLIST                           */
/* TERMMSGS = MESSAGES                         */
/* TRACE TURNS ON MESSAGING                    */
/***********************************************/
 
 
INITIALIZE:
return_code = 0
old_resource = "               "
uidstr = "UID("
spc = "               "
 
 
MESSAGE_HOUSEKEEPING:
"VPUT (CONSLIST COMLIST SYMLIST TERMMSGS) ASIS"
return_code = 0
 
/* DETERMINE WHICH SECURITY SYSTEM IS RUNNING */
"SELECT CMD(%CACC1000 ACP)"
"VGET (ACPNAME,ACPVERS) ASIS"
 
If acpname <> "ACF2" then do
  Say pgmname acpname acpvers
  Say pgmname "ACF2 JOB RUNNING ON THE WRONG SYSTEM"
  return_code = 12
  SIGNAL  ERR_EXIT
  End
 
/*************************************************/
/* INITIALIZE LIBRARY MANAGEMENT FOR SHOWALL     */
/*************************************************/
return_code = 0
 
 
LIBRARY_INITIALIZE:
"LMINIT DATAID(TEMPS) DDNAME(TEMPS)"
lminit_temps_error = return_code
If return_code <> 0 then,
  SIGNAL ERR_EXIT
 
return_code = 0
"LMINIT DATAID(PDIDD) DDNAME(PDIDD)"
lminit_pdidd_error = return_code
If return_code <> 0 then,
  SIGNAL ERR_EXIT
 
If test <> "MOD" then do
  return_code = 0
  "LMOPEN DATAID("temps") OPTION(OUTPUT)"
  lmopen_temps_error = return_code
  If return_code <> 0 then,
    SIGNAL ERR_EXIT
 
  x = outtrap("out.")
 
  queue "SHOW CLASMAP"
  queue "QUIT"
  Address TSO "ACF"
 
  Do X = 1 to out.0
    ab = out.x
    abl = length(ab)
    "LMPUT DATAID("temps") MODE(INVAR) DATALOC(AB)",
      "DATALEN("abl") NOBSCAN"
    End
 
  return_code = 0
  "LMCLOSE DATAID("temps")"
  lmclose_temps_error = return_code
  If return_code <> 0 then,
    SIGNAL ERR_EXIT
  End
 
 
BYPASS_SETROPTS:
return_code = 0
"VPUT (CONSLIST COMLIST SYMLIST TERMMSGS TEMPS PDIDD) ASIS"
vput_error = return_code
If return_code > 0 then,
  SIGNAL ERR_EXIT
 
return_code = 0
"VIEW DATAID("temps") MACRO("caam0506")"
  edit_temps_error = return_code
If return_code > 4 then,
  SIGNAL ERR_EXIT
 
return_code = 0
"VGET (AM06VGE) ASIS"
vget_error = return_code
 
return_code = 0
 
 
END_EXIT:
"LMFREE DATAID("temps")"
lmfree_temps_error = return_code
 
return_code = 0
"LMFREE DATAID("pdidd")"
lmfree_pdidd_error = return_code
 
return_code = 0
 
 
ERR_EXIT:
If maxcc >= 16 | return_code > 0 then do
  "VGET (ZISPFRC) SHARED"
  If maxcc > zispfrc then,
    zispfrc = /*!*/maxcc
  Else
    zispfrc = return_code
  "VPUT (ZISPFRC) SHARED"
  Say pgmname "ZISPFRC =" zispfrc
  End
 
If termmsgs = "ON" then do
  say "==============================================================="
  say pgmname "LMINIT_TEMPS_ERROR                "lminit_temps_error
  say pgmname "LMINIT_PDIDD_ERROR                "lminit_pdidd_error
  say pgmname "LMOPEN_TEMPS_ERROR                "lmopen_temps_error
  say pgmname "LMCLOSE_TEMPS_ERROR               "lmclose_temps_error
  say pgmname "VPUT_ERROR                        "vput_error
  say pgmname "EDIT_TEMPS_ERROR                  "edit_temps_error
  say pgmname "VGET_ERROR                        "vget_error
  say pgmname "AM06VGE                           "am06vge
  say pgmname "LMFREE_TEMPS_ERROR                "lmfree_temps_error
  say pgmname "LMFREE_PDIDD_ERROR                "lmfree_pdidd_error
  say "==============================================================="
  End
Exit 0
 
 
/*******************************************/
/*  SYSCALL SUBROUTINES                    */
/*******************************************/
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 >= 16 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
 
 
