/* REXX */
/* CLS2REXXed by UMLA01S on 28 Aug 2020 at 16:10:02  */
/*trace r?*/
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
Address ISREDIT
 
"MACRO"               /* CARM0008 EDIT MACRO */
/*********************************************************************/
/* 04/05/2016 CL.Fenton Changes made for possible running with no    */
/*            data in CART0002.                                      */
/* 08/28/2028 CL.Fenton Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "CARM0008 08/28/20"
sysprompt = "OFF"                       /* CONTROL NOPROMPT          */
sysflush = "OFF"                        /* CONTROL NOFLUSH           */
sysasis = "ON"                          /* CONTROL ASIS - caps off   */
return_code = 0
maxcc = 0
max_rc = 0
Address ISPEXEC "CONTROL NONDISPL ENTER"
Address ISPEXEC "CONTROL ERRORS RETURN"
return_code = 0   /* SET RETURN CODE TO 0 */
/* *************************************** */
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* *************************************** */
/* GET VARIABLES FROM POOL */
Address ISPEXEC "VGET (CONSLIST COMLIST SYMLIST TERMMSGS) ASIS"
return_code = rc
If return_code <> 0 then do
  Say pgmname "VGET_RC =" return_code zerrsm
  Say pgmname "CONSLIST/"conslist "COMLIST/"comlist,
    "SYMLIST/"symlist "TERMMSGS/"termmsgs
  rm8vge = return_code
  end
Else,
  rm8vge = 0
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" ,
  then Trace r
 
/*******************************************/
/* Turn on Messages                        */
/*******************************************/
CARM8_MESSAGE_HOUSEKEEPING:
syssymlist = symlist                    /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist                   /* CONTROL CONLIST/NOCONLIST */
syslist = comlist                       /* CONTROL LIST/NOLIST       */
sysmsg = termmsgs                       /* CONTROL MSG/NOMSG         */
return_code = 0
/*******************************************/
/* GET TABLE VALUES                        */
/*******************************************/
"(ENDER) = LINENUM .ZLAST"
trows = ender
icnt = 0
Address ISPEXEC "VPUT (ICNT TROWS) ASIS"
icnt = 1
Do CNT = 1 to ender
  "(DATA) = LINE" cnt
  If pos("*",data) = 0 then do
    interpret "ALPHA"icnt "= substr(data,1,8)"
    interpret "BETA"icnt "= substr(data,10,1)"
    Address ISPEXEC "VPUT (ALPHA"icnt "BETA"icnt "ICNT TROWS) ASIS"
    icnt = icnt + 1
    end
  end
 
Address ISPEXEC "VPUT (RM8VGE) ASIS"
"END"
Exit
 
 
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
 
 
