From: "Pullman, Nick" <[EMAIL PROTECTED]>
Thanks Dave. That seemed to work for part of it, but I am getting an error if I am trying to assign a value to the variable within the loop; i.e. assign a value using this type of variable. /* This CLIST demonstrates how to create an array. */
/**********************************************************************/
SET &COUNT = 1
DO WHILE &COUNT < 4
   SET &&COLOR&COUNT = &COUNT
   SET &TEMP = &&COLOR&COUNT
   WRITE &TEMP
   SET &COUNT = &COUNT + 1
END


Nick,

In the CLIST above, no value has been set for &COLOR so the variable resolves to null. &COUNT has an initial value of 1, so the entire thing resolves to the following:

SET &1 = 1

Variables cannot have numeric names; e.g. &1 is not a valid name for a variable. This is why the CLIST is displaying an error message. To fix the problem, simply assign a value to &COLOR.

Hope that helps,

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