Itschak Mugzach wrote:
I read a record from a dataset. A field named A holds the string value of
'ABCD**'. I then pass the name of the variable to a routine. The routine
resolved the value by name using VALUE(A). If A hold string of **, REXX
thinks this is a power operation,. In Clist, you can limit the number of
levels it will interprate the variable. I want REXX to return value by name
without trying to resolve it and reference it like a string variable.
Itschak
VALUE() only does 1 level of interpretation..
/**/
A='**'
SAY VALUE('A')
works..
In your example, you were doing :
/**/
A='**'
SAY VALUE(A)
which is the same as
SAY VALUE('**')
or also the same as
SAY VALUE(VALUE('A'))
So, you have to make sure you are indeed passing the NAME of the
variable to your procedure, not the value.
So, something like this should work :
*** TOP OF FILE ***
/**/
A='**'
SAY DUPIT('A')
exit 0
DUPIT:
parse arg v .
return value(v).value(v)
*** END OF FILE ***
This should yield '****'
--Ivan
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html