PROC 0                                                                -
  CONSLIST(OFF)              /* DEFAULT IS OFF                     */ -
  COMLIST(OFF)               /* DEFAULT IS OFF                     */ -
  SYMLIST(OFF)               /* DEFAULT IS OFF                     */ -
  TERMMSGS(ON)               /* DEFAULT IS OFF                     */ -
  TYPERUN(FSO)               /* Run for SRRAUDIT | FSO             */ -
  CACC1000(CACC1000)         /* SELECT SECURITY CHECK PGM          */ -
  CACM000T(CACM000T)         /* SELECT edit macro/CACT0000         */ -
  CACM0422(CACM0422)         /* SELECT EDIT macro AUACCESS(*)      */ -
  CACT0000(CACT0000)         /* SELECT MVS REPORT TABLE            */ -
  CACT0008(CACT0008)         /* SELECT MVS REPORT TABLE            */ -
  CATM0405(CATM0405)         /* DEFAULT MACRO TSSLISTP             */ -
  CATM0420(CATM0420)         /* SELECT EDIT macro TEMP6(iter)      */ -
  AUACCESSDD(AUACCESS)       /* Default DDNAME - Work file         */ -
  CNTLDD(CNTL)               /* Default DDNAME - Security table    */ -
  DIALOGDD(DIALOG)           /* Default DDNAME - Authorized users  */ -
  PDIDD(PDIDD)               /* Default DDNAME - PDI data set      */ -
  SENSITVEDD(SENSITVE)       /* Default DDNAME - Sensitive rpts    */ -
  TEMP6DD(TEMP6)             /* Default DDNAME - TEMP records      */ -
  TSSLISTPDD(TSSLISTP)       /* Default DDNAME - TSSLISTP records  */ -
  TRACE(OFF)                 /* TRACE ACTIONS AND ERRORS           */
 
/* 06/01/2004 JL.NELSON CREATE TO REPORT NEW FINDINGS
/* 07/12/2004 JL.NELSON copied from CARC0420 for TSS
/* 11/16/2004 JL.NELSON Added code for Authorized users
/* 01/25/2005 JL.NELSON Changed to add dslist to PDIs
/* 02/08/2005 JL.NELSON Changed constants to variables
/* 03/28/2005 JL.NELSON Added TYPERUN for Reports without PDIs
/* 04/12/2005 JL.NELSON Added PDI NF records for no input datasets
/* 06/08/2005 JL.NELSON Pass MAXCC in ZISPFRC variable
/* 06/15/2005 JL.NELSON Reset return code to end job step
/* 07/19/2005 JL.NELSON Changed empty report text per Charles
/* 03/16/2006 JL.NELSON Set/test RCode for every ISPEXEC command.
/* 03/21/2006 JL.NELSON Use NRSTR avoid abend 900 if ampersand in data.
/* 05/09/2006 JL.NELSON Added WRITE &LASTCC for debugging.
/* 05/23/2006 JL.NELSON Added fields for TSSSIM calls.
/* 09/29/2006 CL.FENTON Added variable to activate/deactivate use
/*            TSSSIM calls.  Default is ON.
/* 02/10/2008 CL FENTON Removed CACCACP0 to refer to CACC1000.
/* 03/31/2008 CL FENTON Script modified to use new input information.
/* 06/02/2009 CL.FENTON Changes CACT0001 to CACT0000, CACM042V to
/*            CACM000T.  Changes for reflect new table information.
/* 06/05/2012 CL.FENTON Chgs to allow use of AUACCESS for authorized
/*            users list to prevent the possible "IKJ56548I INSUFFICIENT
/*            STORAGE FOR CLIST TO CONTINUE" message from occurring when
/*            a DIALOG user group contains an excessive number of user,
/*            CSD-AR003400969.
/* 08/26/2016 CL.FENTON Correct issue with TBLMBR.
 
SET PGMNAME = &STR(CATC0420 08/16/16)
 
SET SYSPROMPT = OFF                 /* CONTROL NOPROMPT          */
SET SYSFLUSH  = OFF                 /* CONTROL NOFLUSH           */
SET SYSASIS   = ON                  /* CONTROL ASIS - caps off   */
 
/* ERROR ROUTINE */
ERROR DO
  SET RETURN_CODE = &LASTCC          /* SAVE LAST ERROR CODE */
  IF &LASTCC GT 16 THEN +
    WRITE &PGMNAME LASTCC = &LASTCC &ZERRLM
  RETURN
  END
 
SET RETURN_CODE = 0
 
IF &NRSTR(&TRACE) EQ ON THEN DO     /* TURN messages on          */
  SET TERMMSGS = ON                 /* CONTROL MSG               */
  SET COMLIST  = ON                 /* CONTROL LIST              */
  SET CONSLIST = ON                 /* CONTROL CONLIST           */
  SET SYMLIST  = ON                 /* CONTROL SYMLIST           */
  END
 
SET SYSSYMLIST = &SYMLIST           /* CONTROL SYMLIST/NOSYMLIST */
SET SYSCONLIST = &CONSLIST          /* CONTROL CONLIST/NOCONLIST */
SET SYSLIST    = &COMLIST           /* CONTROL LIST/NOLIST       */
SET SYSMSG     = &TERMMSGS          /* CONTROL MSG/NOMSG         */
 
SET ZISPFRC = 0
ISPEXEC VPUT (ZISPFRC) SHARED
 
SET RETURN_CODE = 0
 
ISPEXEC VPUT ( +
  CONSLIST     +
  COMLIST      +
  SYMLIST      +
  TERMMSGS     +
  CACT0000     +
  CACT0008     +
  CACM0422     +
  CATM0405     +
  TYPERUN      +
  ) ASIS
 
SET TC20VPUT = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME VPUT RC = &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
/* Determine which security system is running */
 
SET RETURN_CODE = 0
 
ISPEXEC SELECT CMD(&CACC1000 ACP)
 
ISPEXEC VGET ( +
  ACPNAME      +
  ACPVERS      +
  ) ASIS
 
IF &SUBSTR(1:3,&NRSTR(&ACPNAME   )) NE TSS THEN DO
  WRITE &PGMNAME Top Secret Job running on the wrong system.
  WRITE &PGMNAME &ACPNAME &ACPVERS
  SET RETURN_CODE = 20
  GOTO ERR_EXIT
  END
 
/* *************************************** */
/* INITIALIZE LIBRARY MANAGEMENT           */
/* *************************************** */
 
SET LP = &STR((
SET RP = )
SET AUACCCNT = 0
 
SET RETURN_CODE = 0
ISPEXEC LMINIT DATAID(AUACCESS) DDNAME(&AUACCESSDD) ENQ(EXCLU)
SET LMINIT_AUACCESS_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_AUACCESS_RC = &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(CNTL) DDNAME(&CNTLDD)
SET LMINIT_CNTL_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_CNTL_RC = &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(DIALOG) DDNAME(&DIALOGDD)
SET LMINIT_DIALOG_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_DIALOG_RC = &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(PDIDD) DDNAME(&PDIDD)
SET LMINIT_PDIDD_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_PDIDD_RC &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(SENSITVE) DDNAME(&SENSITVEDD)
SET LMINIT_SENSITVE_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_SENSITVE_RC = &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(TEMP6) DDNAME(TEMP6)
SET LMINIT_TEMP6_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_TEMP6_RC &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMINIT DATAID(TSSLISTP) DDNAME(&TSSLISTPDD)
SET LMINIT_TSSLISTP_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMINIT_TSSLISTP_RC &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
LISTDSI &SENSITVEDD FILE
 
SET LISTDSI_FILE_RCODE   = &RETURN_CODE
SET LISTDSI_FILE_REASON = &SYSREASON
IF &SYSREASON EQ 0 THEN DO
  SET ODSNAME  = &SYSDSNAME
  SET LISTDSI_FILE_MSGLVL2 = &NRSTR(&SYSMSGLVL2)
  END
ELSE DO
  WRITE &PGMNAME LISTDSI failed for SENSITVE &SYSREASON
  WRITE &PGMNAME &NRSTR(&SYSMSGLVL1)
  WRITE &PGMNAME &NRSTR(&SYSMSGLVL2)
  END
 
SET RETURN_CODE = 0
 
LISTDSI &TEMP6DD FILE
 
SET LISTDSI_FILE_RCODE   = &RETURN_CODE
SET LISTDSI_FILE_REASON = &SYSREASON
IF &SYSREASON EQ 0 THEN DO
  SET TDSNAME  = &SYSDSNAME
  SET LISTDSI_FILE_MSGLVL2 = &NRSTR(&SYSMSGLVL2)
  END
ELSE DO
  WRITE &PGMNAME LISTDSI failed for TEMP6 &SYSREASON
  WRITE &PGMNAME &NRSTR(&SYSMSGLVL1)
  WRITE &PGMNAME &NRSTR(&SYSMSGLVL2)
  END
 
/* *************************************** */
/* OPEN DATASETS                           */
/* *************************************** */
 
SET RETURN_CODE = 0
 
ISPEXEC LMOPEN DATAID(&AUACCESS) OPTION(INPUT)
SET LMOPEN_AUACCESS_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMOPEN_AUACCESS_RC &RETURN_CODE  &ZERRSM
  GOTO ERR_EXIT
  END
 
ISPEXEC LMOPEN DATAID(&CNTL) OPTION(INPUT)
SET LMOPEN_CNTL_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMOPEN_CNTL_RC &RETURN_CODE  &ZERRSM
  GOTO ERR_EXIT
  END
 
ISPEXEC LMOPEN DATAID(&DIALOG) OPTION(INPUT)
SET LMOPEN_DIALOG_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMOPEN_DIALOG_RC &RETURN_CODE  &ZERRSM
  GOTO ERR_EXIT
  END
 
ISPEXEC LMOPEN DATAID(&PDIDD) OPTION(OUTPUT)
SET LMOPEN_PDIDD_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMOPEN_PDIDD_RC &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC LMOPEN DATAID(&SENSITVE) OPTION(OUTPUT)
SET LMOPEN_SENSITVE_RC = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMOPEN_SENSITVE_RC &RETURN_CODE &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
/* *************************************** */
/* PUT VARS IN POOL                        */
/* *************************************** */
 
ISPEXEC VPUT ( +
  CNTL         +
  DIALOG       +
  AUACCESS     +
  AUACCCNT     +
  PDIDD        +
  SENSITVE     +
  TSSLISTP     +
  ) ASIS
 
/* *************************************** */
/* GET TABLE VALUES                        */
/* *************************************** */
 
SET RETURN_CODE = 0
 
ISPEXEC VIEW DATAID(&CNTL) MACRO(&CACM000T) MEMBER(&CACT0000)
 
SET VIEW_CACT0000_RC = &RETURN_CODE
IF &RETURN_CODE GT 4 THEN DO
  WRITE &PGMNAME VIEW_CACT0000_RC &RETURN_CODE  &ZERRSM
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
ISPEXEC VGET (TBLMBR) ASIS
 
SET TBLMBR = &NRSTR(&TBLMBR)
/*SET TBLMBR = &NRSTR(&TBLMBR.#)
 
SET RETURN_CODE = 0
 
/* *************************************** */
/* EDIT TSS  REPORTS                       */
/* *************************************** */
 
DO X = 2 TO &LENGTH(&NRSTR(&TBLMBR))
  SET ITER   = &SUBSTR(&X:&X+1,&NRSTR(&TBLMBR))
  SET RPTMBR = &SUBSTR(&X+3:&X+11,&NRSTR(&TBLMBR))
  SET PDIMBR = &SUBSTR(&X+12:&X+19,&NRSTR(&TBLMBR))
  SET Y      = &SYSINDEX(&NRSTR(@),&NRSTR(&TBLMBR),&X)
  IF &Y GT 0 THEN +
    SET TITLE  = &SUBSTR(&X+21:&Y-1,&NRSTR(&TBLMBR))
  ELSE +
    SET TITLE  =
  SET X      = &SYSINDEX(&STR(#),&NRSTR(&TBLMBR),&X)
 
  SET RPTMBR = &RPTMBR
  SET PDIMBR = &PDIMBR
 
  ISPEXEC VPUT ( +
    PDIMBR       +
    RPTMBR       +
    ODSNAME      +
    ) ASIS
 
  SET RETURN_CODE = 0
 
  SET LOCATE = &SYSDSN('&TDSNAME(&ITER)')
 
  IF &NRSTR(&LOCATE) EQ OK THEN GOTO CHECK_SENSMBR
 
  WRITE &PGMNAME SYSDSN ITER RC = 8 &TDSNAME(&ITER) +
    &LOCATE
 
  /* *************************************** */
  /* PUT HEADINGS OUT                        */
  /* *************************************** */
 
  SET HEADLINE = &NRSTR(                    &TITLE)
  SET AC = &NRSTR(&HEADLINE)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET HEADLIN1 = &STR(========================================)
  SET HEADLIN1 = &NRSTR(&HEADLIN1&HEADLIN1&HEADLIN1)
  SET AC = &NRSTR(&HEADLIN1)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET HEADLIN3 = &STR(The datasets in this category are not listed +
    for one of the following reasons: )
  SET AC = &NRSTR(&HEADLIN3)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &STR( )
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET HEADLIN4 = &STR(1&RP Datasets have been listed previously +
    in other reports.  Therefore, to avoid duplication, they have +
    been omitted from this report.)
  SET AC = &NRSTR(&HEADLIN4)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET HEADLIN5 = &STR(2&RP Datasets were not collected for this +
    category. )
  SET AC = &NRSTR(&HEADLIN5)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET HEADLIN6 = &STR(3&RP A security violation or error occurred +
    with the ACP command used in the collecting of information +
    for datasets.)
  SET AC = &NRSTR(&HEADLIN6)
 
  ISPEXEC LMPUT DATAID(&SENSITVE) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET RETURN_CODE = 0
 
  ISPEXEC LMMADD DATAID(&SENSITVE) MEMBER(&RPTMBR)
 
  IF &RETURN_CODE EQ 4 THEN DO          /* MEMBER ALREADY EXISTS
    SET RETURN_CODE = 0
 
    ISPEXEC LMMREP DATAID(&SENSITVE) MEMBER(&RPTMBR)
 
    IF &RETURN_CODE NE 0 THEN +
      WRITE &PGMNAME LMMREP_SENSITVE_RC = &RETURN_CODE &RPTMBR &ZERRSM
    END
  ELSE DO
    IF &RETURN_CODE NE 0 THEN +
      WRITE &PGMNAME LMMADD_SENSITVE_RC = &RETURN_CODE &RPTMBR &ZERRSM
    END
 
  IF &NRSTR(&PDIMBR) EQ &STR( ) THEN GOTO DO_CNT_END
 
  SET AC = &STR(Not a Finding)
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &STR( )
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &NRSTR(&HEADLIN3)
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &STR( )
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &NRSTR(&HEADLIN4)
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &NRSTR(&HEADLIN5)
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET AC = &NRSTR(&HEADLIN6)
 
  ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(AC) +
    DATALEN(&LENGTH(&NRSTR(&AC)))
 
  SET RETURN_CODE = 0
 
  ISPEXEC LMMADD DATAID(&PDIDD) MEMBER(&PDIMBR)
 
  IF &RETURN_CODE EQ 4 THEN DO          /* MEMBER ALREADY EXISTS
    SET RETURN_CODE = 0
 
    ISPEXEC LMMREP DATAID(&PDIDD) MEMBER(&PDIMBR)
 
    IF &RETURN_CODE NE 0 THEN +
      WRITE &PGMNAME LMMREP_PDIDD_RC = &RETURN_CODE &PDIMBR &ZERRSM
    END
  ELSE DO
    IF &RETURN_CODE NE 0 THEN +
      WRITE &PGMNAME LMMADD_PDIDD_RC = &RETURN_CODE &PDIMBR &ZERRSM
    END
 
  GOTO DO_CNT_END
 
 
CHECK_SENSMBR: +
  SET RETURN_CODE = 0
 
  /* *************************************** */
  /* PUT VARS IN POOL                        */
  /* *************************************** */
 
  SET RESTYPE = &STR(DSN)
 
  ISPEXEC VPUT ( +
    TITLE        +
    PDIMBR       +
    RPTMBR       +
    RESTYPE      +
    ODSNAME      +
    ) ASIS
 
  IF &NRSTR(&PDIMBR) EQ &STR( ) THEN GOTO DO_CNT_END
 
  /* *************************************** */
  /* Get authorized users                    */
  /* *************************************** */
  SET RETURN_CODE = 0
 
  ISPEXEC EDIT DATAID(&AUACCESS) MACRO(&CACM0422) MEMBER(&RPTMBR)
 
  SET RETURN_CODE = 0
 
  ISPEXEC EDIT DATAID(&TEMP6) MACRO(&CATM0420) MEMBER(&ITER)
 
  IF &RETURN_CODE GT 4 THEN +
    WRITE &PGMNAME VIEW_TEMP6_RC = &RETURN_CODE &ITER  &ZERRSM
 
DO_CNT_END: END
 
/* CHANGE END */
/* *************************************** */
/* CLOSE OUTPUT                            */
/* *************************************** */
 
CLOSEUP: +
SET RETURN_CODE = 0
 
ISPEXEC LMCLOSE DATAID(&AUACCESS)
SET LMCLOSE_AUACCESS_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCLOSE DATAID(&CNTL)
SET LMCLOSE_CNTL_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCLOSE DATAID(&DIALOG)
SET LMCLOSE_DIALOG_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCLOSE DATAID(&PDIDD)
SET LMCLOSE_PDIDD_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCLOSE DATAID(&SENSITVE)
SET LMCLOSE_SENSITVE_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCOMP DATAID(&PDIDD)
SET LMCOMP_PDIDD_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMCOMP DATAID(&TEMP6)
SET LMCOMP_TEMP6_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
/* *************************************** */
/* FREE FILES                              */
/* *************************************** */
 
ISPEXEC LMFREE DATAID(&AUACCESS)
SET LMFREE_CNTL_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&CNTL)
SET LMFREE_CNTL_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&DIALOG)
SET LMFREE_CNTL_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&PDIDD)
SET LMFREE_PDIDD_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&SENSITVE)
SET LMFREE_SENSITVE_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&TEMP6)
SET LMFREE_TEMP6_RC = &RETURN_CODE
SET RETURN_CODE = 0
 
ISPEXEC LMFREE DATAID(&TSSLISTP)
SET LMFREE_TSSLISTP_RC = &RETURN_CODE
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
 
ISPEXEC VGET ( +
  TM20VGET     +
  TM420RC      +
  TM21VGET     +
  TM421RC      +
  CM2VVGET     +
  CM2VVPUT     +
  CM42VRC      +
  ) ASIS
 
IF &NRSTR(&TERMMSGS) EQ ON THEN DO
WRITE ===============================================================
WRITE &PGMNAME LMINIT_AUACCESS_RC       &LMINIT_AUACCESS_RC
WRITE &PGMNAME LMINIT_CNTL_RC           &LMINIT_CNTL_RC
WRITE &PGMNAME LMINIT_DIALOG_RC         &LMINIT_DIALOG_RC
WRITE &PGMNAME LMINIT_PDIDD_RC          &LMINIT_PDIDD_RC
WRITE &PGMNAME LMINIT_SENSITVE_RC       &LMINIT_SENSITVE_RC
WRITE &PGMNAME LMINIT_TEMP6_RC          &LMINIT_TEMP6_RC
WRITE &PGMNAME LMINIT_TSSLISTP_RC       &LMINIT_TSSLISTP_RC
WRITE ===============================================================
WRITE &PGMNAME LMOPEN_AUACCESS_RC       &LMOPEN_AUACCESS_RC
WRITE &PGMNAME LMOPEN_CNTL_RC           &LMOPEN_CNTL_RC
WRITE &PGMNAME LMOPEN_DIALOG_RC         &LMOPEN_DIALOG_RC
WRITE &PGMNAME LMOPEN_PDIDD_RC          &LMOPEN_PDIDD_RC
WRITE &PGMNAME LMOPEN_SENSITVE_RC       &LMOPEN_SENSITVE_RC
WRITE ===============================================================
WRITE &PGMNAME VIEW_CACT0000_RC         &VIEW_CACT0000_RC
WRITE &PGMNAME &CATM0420 VGET            &TM20VGET
WRITE &PGMNAME &CATM0420 TM420RC         &TM420RC
WRITE ===============================================================
WRITE &PGMNAME LMCLOSE_AUACCESS_RC      &LMCLOSE_AUACCESS_RC
WRITE &PGMNAME LMCLOSE_CNTL_RC          &LMCLOSE_CNTL_RC
WRITE &PGMNAME LMCLOSE_DIALOG_RC        &LMCLOSE_DIALOG_RC
WRITE &PGMNAME LMCLOSE_PDIDD_RC         &LMCLOSE_PDIDD_RC
WRITE &PGMNAME LMCLOSE_SENSITVE_RC      &LMCLOSE_SENSITVE_RC
WRITE ===============================================================
WRITE &PGMNAME LMCOMP_PDIDD_RC          &LMCOMP_PDIDD_RC
WRITE &PGMNAME LMCOMP_TEMP6_RC          &LMCOMP_TEMP6_RC
WRITE ===============================================================
WRITE &PGMNAME LMFREE_AUACCESS_RC       &LMFREE_AUACCESS_RC
WRITE &PGMNAME LMFREE_CNTL_RC           &LMFREE_CNTL_RC
WRITE &PGMNAME LMFREE_DIALOG_RC         &LMFREE_DIALOG_RC
WRITE &PGMNAME LMFREE_PDIDD_RC          &LMFREE_PDIDD_RC
WRITE &PGMNAME LMFREE_SENSITVE_RC       &LMFREE_SENSITVE_RC
WRITE &PGMNAME LMFREE_TEMP6_RC          &LMFREE_TEMP6_RC
WRITE &PGMNAME LMFREE_TSSLISTP_RC       &LMFREE_TSSLISTP_RC
WRITE ===============================================================
END
 
EXIT CODE(0)
