Passing a variable from a Global Variable Table to a rexx parse.
search cancel

Passing a variable from a Global Variable Table to a rexx parse.

book

Article ID: 209274

calendar_today

Updated On:

Products

ESP Workload Automation

Issue/Introduction

I have an ESP proc using REXX that is trying to parse an ESP global variable.

What needs to be done to get the PARSE instruction to work using a variable that equals the global variable name?

 

 

Environment

Release : 12.0

Component : CA ESP WORKLOAD AUTOMATION

Cause

Converting REXX variable to ESP variable within a PARSE.

Resolution

In order to parse a variable assigned in a Global Variable Table you would need the following.

REXXON                                 
TRACE I                                
                                       
  VARNAM='JHHT'       /*  set VARNAM to JHHT  */                      
                                       
  "VARNAM='"VARNAM"'"                 /* Pass REXX variable VARNAM  */ 
"ESP VGET (%VARNAM) TABLE(VIEWMAIL)"   /* Get the variable JHHT from GVT  */
                       
  VARNAM1 = CLANGVAR('%JHHT')   /* Convert REXX variable to ESP Variable   */          
                                       
                                       
  PARSE VAR VARNAM1 JNAME JNUMBER MSG  /* Parse the ESP variable JHHT  */ 
                                       
   "JNUMBER = '"JNUMBER"'"             
   "JNAME = '"JNAME"'"                 
   "MSG = '"MSG"'"                     
                                       
REXXOFF