Dave Salt wrote:
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.

This also points out another fundamental difference:
in REXX, an unititialized variable has its own name
as the default value; in CLIST the default value is
null.

<ad>
So, Nick, How about a CLIST class? If you have
a lot of this stuff to do, our 3-day class "TSO
CLIST Programming in z/OS" might be just the
ticket.

Details at
http://www.trainersfriend.com/TSO_Clist_REXX_Dialog_Mgr/a650descrpt.htm

</ad>
Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

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