I used to write in CLIST quite a lot.  Then one day I intercepted a warning 
from IBM that someday soon they might stop supporting CLIST and REXX would 
become the One and Only; so I picked up a REXX manual and quickly became a fan. 
 (That was decades ago, and CLIST is still around; I've since heard that IBM 
issues that warning periodically but so far has done nothing about it.  I'm 
still a REXX bigot.)  So it's been a while since I've written very much in 
CLIST, and I have some questions:

1) What's that extra ampersand in the first statement, and again near the end 
of the loop?  I've a notion it adds an extra layer of interpretation to the 
variable name:  &XYZ means the value of the XYZ variable, but &&XYZ means the 
value of the variable that is named by XYZ.  For example, if XYZ contains 
"ABC", and there's a variable named ABC that contains the string "Hi, there!", 
then WRITE &XYZ would display "ABC" but WRITE &&XYZ would display "Hi, there!". 
 In REXX that's the difference between XYZ and VALUE(XYZ).  If that's not 
right, someone please correct me.

2) I keep thinking &SYMBOL is some special value in CLIST, but I can't find in 
it the manual.  John treats it as just another variable name, and I'll assume 
for this translation that he's right.  But again, if I'm mistaken, someone 
please correct me.

Given those two assumptions, I would correct John's translation this way:

  varnx=value(varn||glcv)
  if varnx=symbol then do
    varfnd=1
    varvx=value(varv||glcv)
    symbol=varvx
    end

Like Mr McKown, I think this is right but I haven't tested the code to be sure.

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* Give a man fire and he's warm for a day; set him on fire and he's warm for 
the rest of his life.  -found on the web */


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of John McKown
Sent: Thursday, March 19, 2020 10:41
>
This might help:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikjb800/ikjb80059.htm

I _think_ the following is correct, but I am not sure.

  VARNX=VARN||GLCV /* CREATE NAME OF VARIABLE */
  IF (VATNX=SYMBOL) THEN DO; /* IF NAME OF VARIABLE IS THE SYMBOL WE ARE
      LOOKING FOR */
    VARFND=1 /* WE'VE FOUND THE SYMBOL */
    VARVX=VARV||GLCV /* CREATE THE NAME OF THE VARIABLE WHOSE VALUE WE
      WANT */
    SYMBOL=VALUE(VARVX) /* GET VALUE OF VARIABLE WHOSE NAME IS IN VARVX */
    END

The comments are strictly my own.

--- On Thu, Mar 19, 2020 at 9:20 AM David Crayford <dcrayf...@gmail.com> wrote:
> I'm trying to convert CLIIST to REXX and CLIST has symbolic
> substitution. I've used this before in NCL but it's a long time ago.
>
> Can anybody tell me what this does and translate to REXX? I'm guessing I
> need to use interpret or value()!
>
> SET VARNX = &&VARN&GLCV
> IF (&VARNX = &SYMBOL) THEN DO
>    SET VARFND = 1
>    SET VARVX  = &&VARV&GLCV
>    SET SYMBOL = &STR(&VARVX)
> END

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to