FWIW I attach what happens with REXX's INTERPRET vs CLIST's &&... (but
from memory, as I've had no access to a mainframe for 8+ years)
AFAIK, REXX's INTERPRET can handle only up to 3 or 4 levels of nesting -
as in INTERPRET (INTERPRET (INTERPRET etc.)) or similar - whereas CLIST
can retrieve the values of variables from deeper levels of nesting,
subject to the number of &'s coded to access/retrieve them.
Yes, IIRC INTERPRET returns everything in uppercase - whereas CLIST's
"CONTROL CAPS ASIS" leaves lowercase data 'as is'.
But you'd have to run my CLIST sample code and adjust the number of &'s
if necessary - because I can't check this.
Cheers etc.
On 13/09/2021 16:57, Paul Gilmartin wrote:
>
>> The main differences that I can see is that with interpret the new values
>> are uppercase, and with value the return contains the new variable name.
>>
> Both VALUE() and INTERPRET preserve case of properly quoted symbols.
> Your confusion reinforces Shmuel's contention that VALUE() is easier to
> understand.
>
> I believe VALUE() returns the value of the first arrgunent prior to the
> assignment.
>
> INTERPRET might win in performance by avoiding call/return overhead.
> Testing necessary.
>
> It would be informative to rerun your tests with SIGNAL ON NOVALUE.
>
> TSO-REXX LISTSERV might provide more specialized opinions:
>
> <mailto:[email protected]?subject=Request%20--%20Thanks!%0D%0A&body=INFO%20TSO-REXX%0D%0AThanks%0D%0A>
>
> -- gil
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> .
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
In REXX:
ARG DEBUG
IF DEBUG = 'DEBUG' THEN ,
TRACE I
T = A
A = B
B = C
C = 123
INTERPRET 'SAY "T = "'T
EXIT 0
In CLIST:
PROC 0 DEBUG
CONTROL: +
CONTROL MAIN END(ENDO)
IF &DEBUG = DEBUG | &DEBUG = D THEN +
CONTROL LIST SYMLIST CONLIST MSG
ELSE +
CONTROL NOLIST NOSYMLIST NOCONLIST NOMSG
CONTROL CAPS ASIS
SET T = &&A
SET A = &&B
SET B = &&C
SET C = 123
WRITE WE GOT T1 = &A
WRITE WE GOT T2 = &&&A
WRITE WE GOT T3 = &&&&&A
WRITE WE GOT T4 = &&&&&&&A
EXIT CODE(&MAXCC)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN