/* REXX */
/* CLS2REXXed by FSOX001 on 31 Aug 2017 at 15:15:12  */
Signal On NoValue
Call On Error
Signal On Failure
Signal On Syntax
Parse source opsys . exec_name .
 
/*********************************************************************/
/* 04/11/2007 CL.FENTON Copied from SRR$AUGR                         */
/* 08/31/2017 CL.FENTON Converted script from CLIST to REXX.         */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
pgmname = "SRR$PROD 08/31/17"
pgm8 = substr(pgmname,1,8)
jobinst = "CACJ051D"          /* BATCH Install job for dialog     */
datasuf = "DATA"              /* Data file suffix                 */
datambr = "PRODUCTS"          /* Data file member                 */
Arg OPTION
If option <> "" then do until OPTION = ""
  parse var OPTION key"("val")" OPTION
  val = strip(val,"b","'")
  val = strip(val,"b",'"')
  optcmd = key '= "'val'"'
  interpret optcmd
  end
/***********************************************/
/* CONSLIST = CONLIST                          */
/* COMLIST = LIST                              */
/* TERMMSGS = MESSAGES                         */
/* TRACE TURNS ON MESSAGING                    */
/***********************************************/
Address ISPEXEC
"VGET (CONSLIST COMLIST SYMLIST TERMMSGS) ASIS"
 
If CONSLIST = "ON" | COMLIST = "ON" | SYMLIST = "ON" then,
  Trace r
 
syssymlist = symlist           /* CONTROL SYMLIST/NOSYMLIST */
sysconlist = conslist          /* CONTROL CONLIST/NOCONLIST */
syslist = comlist              /* CONTROL LIST/NOLIST       */
sysmsg = termmsgs              /* CONTROL MSG/NOMSG         */
sysprompt = "OFF"              /* CONTROL NOPROMPT          */
sysflush = "OFF"               /* CONTROL NOFLUSH           */
sysasis = "ON"                 /* CONTROL ASIS - caps off   */
"CONTROL NONDISPL ENTER"
"CONTROL ERRORS RETURN"
return_code = 0
"VGET (SRRUSER ACPNAME) ASIS"
return_code = 0
datadsn = srruser"."datasuf
x = listdsi("'"datadsn"'")
If sysreason <> 0 then do
  srrerr = "Dataset" datasuf" is missing, batch job" jobinst,
    "must be ran to create the file."
  srrerc = sysreason
  zerrlm = datadsn
  srrmsg1 = sysmsglvl1
  srrmsg2 = sysmsglvl2
  "DISPLAY PANEL(SRRPERR)"
  SIGNAL  ERR_EXIT
  end
"LMINIT DATAID(DATAID) DATASET('"datadsn"')"
lminit_dataid_rc = return_code
If return_code <> 0 then do
  Say pgmname "LMINIT_DATAID_RC" return_code zerrsm
  Say pgmname "DSN="datadsn "Data Set Error"
  SIGNAL  ERR_EXIT
  end
"EDIT DATAID("dataid") MEMBER("datambr") MACRO(SRRMPROD)"
edit_dataid_rc = return_code
If return_code > 4 then do
  Say pgmname "EDIT_DATAID_RC =" return_code member zerrsm
  SIGNAL  ERR_EXIT
  end
"LMFREE DATAID("dataid")"
lmfree_dataid_rc = return_code
return_code = 0
/*******************************************/
/* CLIST EXIT                              */
/*******************************************/
 
 
END_EXIT:
return_code = 0
ERR_EXIT:
zispfrc = return_code
"VPUT (ZISPFRC) SHARED"
Exit
 
 
NoValue:
Failure:
Syntax:
say pgmname 'REXX error' rc 'in line' sigl':' strip(ERRORTEXT(rc))
say SOURCELINE(sigl)
Exit
 
 
Error:
return_code = RC
return
 
 
