From: "Shmuel Metz (Seymour J.)" <[EMAIL PROTECTED]>
Where is there a reference to a variable called &COLOR? Shouldn't
&&COLOR&COUNT expand to &(name), where name is COLOR followed by the
value of &COUNT?

Shouldn't that be SET &COLOR1 = 1?


If it worked like REXX, then yes it would work the way you've described. But the way I understand it is that CLIST always ignores the first ampersand and then evaluates the rest of the statement. For example:

SET &COLOR = RED    is exactly the same as coding    SET COLOR = RED

Using the actual code that was failing, then:

SET &&COLOR&COUNT = 1 is exactly the same as coding SET &COLOR&COUNT = 1

If &COLOR is null and &COUNT is 1, then this resolves to:

SET &1 = 1  (which is invalid because a variable name cannot be numeric).

Going the other way where the double ampersands are on the right side of the evaluation and the first ampersand is ignored, then:

SET &TEMP = &&COLOR&COUNT

Resolves to:

SET TEMP = &COLOR1

As TEMP is a valid variable name, the assignment works regardless of whether &COLOR1 has a value or not.

Dave Salt
SimpList(tm) - The easiest, most powerful way to surf a mainframe!
http://www.mackinney.com/products/SIM/simplist.htm

----------------------------------------------------------------------
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

Reply via email to