Not to dismiss the sample at all but... ... this really shows off the grottiness of Classic REXX as a language... I have incantations just like these (and knowing enough of object-oriented languages and Object REXX) I wonder why we haven't ported Open Object Rexx to z/OS yet... Most of this example would be MUCH better if implemented in Object REXX. For example alloc_member and alloc_dsname stems could be attributes/properties/members of a single object. (And increment and decrement operators wouldn't be a bad idea either - though in THIS case some form of collection class would probably be better.)
Martin Martin Packer, Mainframe Performance Consultant, zChampion Worldwide Banking Center of Excellence, IBM +44-7802-245-584 email: [email protected] Twitter / Facebook IDs: MartinPacker From: Bruce Hewson <[email protected]> To: [email protected] Date: 07/11/2010 11:27 Subject: Re: Rexx question - Dynamic generation of variables? Sent by: IBM Mainframe Discussion List <[email protected]> I have found this form quite useful:- alloc_member_cnt = alloc_member_cnt + 1 alloc_member.alloc_member_cnt = my_member alloc_member.my_member = alloc_member_cnt additional information can be retained in the "array":- alloc_dsname.alloc_member_cnt = my_dsn alloc_dsname.my_dsn = alloc_member_cnt allowing you multiple ways to process the data. If Strip(alloc_member.new_member) <> "" Then Do Say "member" new_member "found at entry" alloc_member.new_member End Else Do alloc_member_cnt = alloc_member_cnt + 1 alloc_member.alloc_member_cnt = new_member alloc_member.new_member = alloc_member_cnt End Regards Bruce Hewson ---------------------------------------------------------------------- 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 Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU ---------------------------------------------------------------------- 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

