Page 1 of 1

is it possible to get the variables in the expression?

PostPosted: Wed Aug 31, 2016 11:37 am
by SKANDA
hi,
I want to compare the working storage variables with the operands used in the expression.

eg:
if (ab = c + gf) | (klh = klg +tre) then
do
stm1
end

here I want to get the operands alone used in the above expressions and want to store those operands in an array.
please help me out..

Re: is it possible to get the variables in the expression?

PostPosted: Wed Aug 31, 2016 1:08 pm
by willy jensen
First of all, REXX do not have arrays. REXX have stems, which looks like but are not arrays.
You can do

mystem.1=c
mystem.2=gf
 

and so on. Not really sure what you want to accomplish though.
If all you want to do is display the values as your program runs, then look at the 'trace' instruction, specifically 'trace i' in this case.

Re: is it possible to get the variables in the expression?

PostPosted: Wed Aug 31, 2016 9:43 pm
by Pedro
compare the working storage variables with the operands used in the expression.

They are the same. They are the same unless you somehow made changes that you have not shown.

Like Willy, I do not really understand what you mean. Perhaps you can elaborate on your terminology.

Re: is it possible to get the variables in the expression?

PostPosted: Thu Sep 01, 2016 5:23 pm
by SKANDA
Hi,
My requirement is, to check if all the variables used in the arithmetic expressions of COBOL program are defined in comp3 type or not ..
I want to verify this using rexx coding
for that ,initially I stored all the variable in working storage section in stems
and then I tried to extract the variables used by the expressions in cobol program , to compare with the working storage section ..
but I couldn't .
how to fix this using REXX code...?

Many Thanks
SKANDA

Re: is it possible to get the variables in the expression?

PostPosted: Thu Sep 01, 2016 5:31 pm
by enrico-sorichetti
topic locked, duplicate of

clist-rexx/topic11243.html