PROC 0                                                                -
  CONSLIST(OFF)              /* DEFAULT IS OFF */                     -
  COMLIST(OFF)               /* DEFAULT IS OFF */                     -
  SYMLIST(OFF)               /* DEFAULT IS OFF */                     -
  TERMPRO(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 */
 
/* 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.
 
SET PGMNAME = &STR(CAAC0503 06/06/06)
 
CONTROL NOFLUSH
 
/* ERROR ROUTINE */
ERROR DO
  SET RETURN_CODE = &LASTCC         /* SAVE LAST ERROR CODE */
  IF &LASTCC GE 16 THEN +
    WRITE &PGMNAME LASTCC = &LASTCC &ZERRLM
  RETURN
  END
 
ISPEXEC  CONTROL  NONDISPL  ENTER
ISPEXEC  CONTROL  ERRORS  RETURN
 
/* CAAC0503  */
/* ERROR CODES PREFIXED BY AC0503 */
 
 
/* ******************************************* */
/* CONSLIST = CONLIST                          */
/* COMLIST = LIST                              */
/* SYMLIST = SYMLIST                           */
/* TERMPRO = PROMPT                            */
/* TERMMSGS = MESSAGES                         */
/* TRACE TURNS ON MESSAGING                    */
/* ******************************************* */
 
 
INITIALIZE:                                                           -
                                                                      -
SET RETURN_CODE = 0                 /* SET RETURN CODE TO 0 */
 
SET OLD_RESOURCE = &STR(               )
 
SET UIDSTR = &STR(UID(
 
SET SPC = &STR(               )
 
TRACER:                                                               -
                                                                      -
IF &TRACE = ON THEN                 /* TURN TRACE ON */               -
  DO
    SET CONSLIST = ON
    SET SYMLIST = ON
    SET COMLIST = ON
    SET TERMPRO = ON
    SET TERMMSGS = ON
  END
 
MESSAGE_HOUSEKEEPING:                                                 -
                                                                      -
IF &CONSLIST = ON THEN                                                -
  CONTROL CONLIST                           /* TURN ON CONLIST */
 
IF &SYMLIST = ON THEN                                                 -
  CONTROL SYMLIST                           /* TURN ON SYMLIST */
 
IF &COMLIST = ON THEN                                                 -
  CONTROL LIST                              /* TURN ON LIST */
 
IF &TERMPRO = ON THEN                                                 -
  CONTROL PROMPT                            /* ALLOW TERM PROMPT */
 
IF &TERMMSGS = ON THEN                                                -
  CONTROL MSG                               /* TURN ON MESSAGES */
 
ISPEXEC  VPUT  (                                                      -
  CONSLIST                                                            -
  COMLIST                                                             -
  SYMLIST                                                             -
  TERMPRO                                                             -
  TERMMSGS                                                            -
  ) ASIS
 
SET RETURN_CODE = 0
 
/* DETERMINE WHICH SECURITY SYSTEM IS RUNNING */
 
ISPEXEC SELECT CMD(%CACC1000 ACP)
 
IF &RETURN_CODE LE 4 THEN -
  DO
  ISPEXEC  VGET (ACPNAME,ACPVERS) ASIS
  END
 
IF &STR(&ACPNAME) NE &STR(ACF2) THEN -
  DO
  WRITE CAAC0503 &ACPNAME &ACPVERS
  WRITE CAAC0503 ACF2 JOB RUNNING ON THE WRONG SYSTEM
  SET RETURN_CODE = 12
  GOTO ERR_EXIT
  END
 
/* ********************************************* */
/* INITIALIZE LIBRARY MANAGEMENT FOR SHOWALL     */
/* ********************************************* */
 
SET RETURN_CODE = 0
 
LIBRARY_INITIALIZE:                                                   -
                                                                      -
ISPEXEC  LMINIT DATAID(TEMPS) DDNAME(TEMPS)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMINIT_TEMPS_ERROR = &RETURN_CODE   /* TRAP ERROR CODE */
    GOTO ERR_EXIT                           /* EXIT */
  END
ELSE +
  DO
    SET AC0503_LMINIT_TEMPS_ERROR = 0
  END
 
SET RETURN_CODE = 0
 
ISPEXEC  LMINIT DATAID(PDIDD) DDNAME(PDIDD)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMINIT_PDIDD_ERROR = &RETURN_CODE
    GOTO ERR_EXIT                           /* EXIT */
  END
ELSE                                                                  -
  DO
    SET AC0503_LMINIT_PDIDD_ERROR = 0
  END
 
IF &STR(&TEST) EQ &STR(MOD) THEN GOTO BYPASS_SETROPTS
 
SET RETURN_CODE = 0
 
ISPEXEC  LMOPEN  DATAID(&TEMPS) OPTION(OUTPUT)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMOPEN_TEMPS_ERROR = &RETURN_CODE
    GOTO ERR_EXIT    /* EXIT */
  END
ELSE                                                                  -
  DO
    SET AC0503_LMOPEN_TEMPS_ERROR = 0
  END
 
SET &SYSOUTTRAP = 999999999
 
ACF
SET CMD = &STR(SHOW CLASMAP)
&CMD
 
SET A = &SYSOUTLINE
 
QUIT
 
DO X = 1 TO &A
  SET AB = &&SYSOUTLINE&X
  SET AB = &STR(&AB)
  SET ABL = &LENGTH(&STR(&AB))
  ISPEXEC LMPUT DATAID(&TEMPS) MODE(INVAR) DATALOC(AB) +
    DATALEN(&ABL) NOBSCAN
END
 
SET RETURN_CODE = 0
 
ISPEXEC  LMCLOSE  DATAID(&TEMPS)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMCLOSE_TEMPS_ERROR = &RETURN_CODE
    GOTO ERR_EXIT    /* EXIT */
  END
ELSE                                                                  -
  DO
    SET AC0503_LMCLOSE_TEMPS_ERROR = 0
  END
 
BYPASS_SETROPTS: +
SET RETURN_CODE = 0
 
/* GOTO ERR_EXIT
 
BYPASS: +
ISPEXEC  VPUT  (                                                      -
  CONSLIST                                                            -
  COMLIST                                                             -
  SYMLIST                                                             -
  TERMPRO                                                             -
  TERMMSGS                                                            -
  TEMPS                                                               -
  PDIDD                                                               -
  ) ASIS
 
IF &RETURN_CODE GT 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_VPUT_ERROR = &RETURN_CODE
    GOTO ERR_EXIT    /* EXIT */
  END
ELSE                                                                  -
  DO
    SET AC0503_VPUT_ERROR = 0
  END
 
 
ISPEXEC  VIEW DATAID(&TEMPS) MACRO(&CAAM0506)
 
 
IF &RETURN_CODE GT 4 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_EDIT_TEMPS_ERROR = &RETURN_CODE
    GOTO ERR_EXIT    /* EXIT */
  END
ELSE                                                                  -
  DO
    SET AC0503_EDIT_TEMPS_ERROR = 0
  END
 
 
SET RETURN_CODE = 0
 
ISPEXEC  VGET  (                                                      -
  AM06VGE                                                             -
  ) ASIS
 
IF &RETURN_CODE GT 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_VGET_ERROR = &RETURN_CODE
  END
ELSE                                                                  -
  DO
    SET AC0503_VGET_ERROR = 0
  END
 
SET RETURN_CODE = 0
 
END_EXIT:                                                             -
                                                                      -
ISPEXEC  LMFREE  DATAID(&TEMPS)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMFREE_TEMPS_ERROR = &RETURN_CODE
  END
ELSE                                                                  -
  DO
    SET AC0503_LMFREE_TEMPS_ERROR = 0
  END
 
SET RETURN_CODE = 0
 
ISPEXEC  LMFREE  DATAID(&PDIDD)
 
IF &RETURN_CODE NE 0 THEN                   /* IF ERROR THEN */       -
  DO
    SET AC0503_LMFREE_PDIDD_ERROR = &RETURN_CODE
  END
ELSE                                                                  -
  DO
    SET AC0503_LMFREE_PDIDD_ERROR = 0
  END
SET RETURN_CODE = 0
 
/* *************************************** */
/* ERROR EXIT                              */
/* *************************************** */
 
ERR_EXIT: +
IF &MAXCC GE 16 OR +
   &RETURN_CODE GT 0 THEN DO
  ISPEXEC VGET (ZISPFRC) SHARED
  IF &MAXCC GT &ZISPFRC THEN +
    SET ZISPFRC = &MAXCC
  ELSE +
    SET ZISPFRC = &RETURN_CODE
  ISPEXEC VPUT (ZISPFRC) SHARED
  WRITE &PGMNAME ZISPFRC = &ZISPFRC
  END
 
IF &TERMMSGS = ON THEN                          /* TURN TRACE ON */   -
DO
WRITE ===============================================================
WRITE AC0503_LMINIT_TEMPS_ERROR       -
  &AC0503_LMINIT_TEMPS_ERROR
WRITE AC0503_LMINIT_PDIDD_ERROR       -
  &AC0503_LMINIT_PDIDD_ERROR
WRITE AC0503_LMOPEN_TEMPS_ERROR       -
  &AC0503_LMOPEN_TEMPS_ERROR
WRITE AC0503_LMCLOSE_TEMPS_ERROR      -
  &AC0503_LMCLOSE_TEMPS_ERROR
WRITE AC0503_VPUT_ERROR               -
  &AC0503_VPUT_ERROR
WRITE AC0503_EDIT_TEMPS_ERROR         -
  &AC0503_EDIT_TEMPS_ERROR
WRITE AC0503_VGET_ERROR               -
  &AC0503_VGET_ERROR
WRITE AM06VGE                         -
  &AM06VGE
WRITE AC0503_LMFREE_TEMPS_ERROR       -
  &AC0503_LMFREE_TEMPS_ERROR
WRITE AC0503_LMFREE_PDIDD_ERROR       -
  &AC0503_LMFREE_PDIDD_ERROR
WRITE ===============================================================
END
EXIT CODE(0)
END
