/* REXX */
/* CLS2REXXed by FSOX001 on 12 Jul 2016 at 16:18:59  */
/*Trace ?r*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"               /* CACM0002 EDIT BANNERS  */
/*********************************************************************/
/* 03/19/2025 CL.Fenton Created to evaluate text banners for the     */
/*            following:                                             */
/*            ACF2-FT-000040, RACF-FT-000040, and TSS0-FT-000010 as  */
/*            IFTP0050, SCTASKU0330736.                              */
/*            ACF2-UT-000030, RACF-UT-000030, and TSS0-UT-000010 as  */
/*            IUTN0030, SCTASKU0330747.                              */
/*            ACF2-SH-000030, RACF-SH-000040, and TSS0-SS-000040 as  */
/*            ZSSH0030, SCTASKU0330749.                              */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CACM0002 03/19/25"
sysprompt = "OFF"                /* CONTROL NOPROMPT          */
sysflush = "OFF"                 /* CONTROL NOFLUSH           */
sysasis = "ON"                   /* CONTROL ASIS - caps off   */
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
/*******************************************/
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* SYMLIST                                 */
/* TERMMSGS                                */
/*******************************************/
return_code = 0
Address ISPEXEC "VGET (CONSLIST COMLIST SYMLIST TERMMSGS PDI",
  "PDIDD FDETAIL) ASIS"
If return_code <> 0 then do
  Say pgmname "VGET RC =" return_code strip(zerrsm)
  Say pgmname "CONSLIST/"conslist "COMLIST/"comlist "SYMLIST/"symlist,
    "TERMMSGS/"termmsgs
  Say pgmname "PDI/"pdi "PDIDD/"pdidd
  Say pgmname "FDETAIL/"fdetail
  return_code = return_code + 16
  SIGNAL ERR_EXIT
  end
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" ,
  then Trace r
maxcc = 0
return_code = 0
cnt = 0
/*******************************************/
/* TURN ON MESSAGES                        */
/*******************************************/
syssymlist = symlist          /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist         /* CONTROL CONLIST/NOCONLIST */
syslist = comlist             /* CONTROL LIST/NOLIST       */
sysmsg = termmsgs             /* CONTROL MSG/NOMSG         */
/*******************************************/
/* Main line                               */
/*******************************************/
"(MEMBER) = MEMBER"
"(DSNAME) = DATASET"
"(LASTLINE) = LINENUM .ZLAST"
say pgmname "Number of records" lastline
return_code = listdsi("CNTL" "FILE")
listdsi_exam_rcode = return_code
listdsi_exam_reason = sysreason
If sysreason = 0 then do
  cntldsn = sysdsname
  listdsi_cntl_msglvl2 = sysmsglvl2
  end
Else do
  listdsi_cntl_msglvl1 = sysmsglvl1
  listdsi_cntl_msglvl2 = sysmsglvl2
  end
approved_banner = ""
do nr = 1 to 3
  err_cnt = 0
  return_code = 0
  "COMPARE '"cntldsn"(CACTBNR"nr")'"
  say pgmname "Compare DSN="cntldsn"(CACTBNR"nr") RC="return_code
 
  "(LASTLINE) = LINENUM .ZLAST"
  say pgmname "Number of records" lastline
  do x = 1 to lastline
    return_code = 0
    "(LBLNAME) = LABEL" x
    if return_code <> 0 then iterate
    "(DATALINE) = LINE" x
    if dataline = "" then iterate
/*  if dataline = left("",length(strip(dataline,"T")),"*") then iterate
    say pgmname "LINE:" right(x,4) "LABEL:" lblname "DATA:",
      strip(dataline,"T")*/
    err_cnt = err_cnt + 1
  end
 
  say pgmname "Process found" err_cnt "errors."
  "RESET"
  "RESET LABEL .ZF .ZL"
  if err_cnt = 0 then do
    approved_banner = cntldsn"(CACTBNR"nr")"
    say pgmname approved_banner "matches the requirement for the",
      "banner."
    leave
    end
end
 
if err_cnt = 0 then do
  ac = "Not a Finding"
  end
Else do
  ac = fdetail
  end
 
Address ISPEXEC "LMPUT DATAID("pdidd") MODE(INVAR) DATALOC(ac)",
  "DATALEN("length(ac)") MEMBER("pdi")"
cnt = cnt + 1
ac = " "
Address ISPEXEC "LMPUT DATAID("pdidd") MODE(INVAR) DATALOC(ac)",
  "DATALEN("length(ac)") MEMBER("pdi")"
cnt = cnt + 1
 
do x = 1 to lastline
  "(DATALINE) = LINE" x
  ac = "    " dataline
  Address ISPEXEC "LMPUT DATAID("pdidd") MODE(INVAR) DATALOC(ac)",
    "DATALEN("length(ac)") MEMBER("pdi")"
  cnt = cnt + 1
  end
 
Address ISPEXEC "LMMADD DATAID("pdidd") MEMBER("pdi")"
if RC = 4 then do
  Address ISPEXEC "LMMREP DATAID("pdidd") MEMBER("pdi")"
  if RC <> 0 then,
    say PGMNAME 'LMMREP_PDIDD =' RC PDI ZERRSM
  end
 
say pgmname right(cnt,4) 'records written for' pdi'.'
 
/*******************************************/
/* END PROCESSES                           */
/*******************************************/
return_code = 0
 
 
ERR_EXIT:
If maxcc >= 16 | return_code > 0 then do
  Address ISPEXEC "VGET (ZISPFRC) SHARED"
  If maxcc > zispfrc then
    zispfrc = maxcc
  Else
    zispfrc = return_code
  Address ISPEXEC "VPUT (ZISPFRC) SHARED"
  Say pgmname "ZISPFRC =" zispfrc
  end
 
"END"
Exit (0)
 
 
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 > 4 & RC <> 8 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
 
 
