IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is ARRAY concept available in CLIST?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Tue May 19, 2009 11:22 am
Reply with quote

Is ARRAY concept available in CLIST? If yes, what is the SYNTAX for the same. Thanks.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 19, 2009 12:26 pm
Reply with quote

I'm not a CLIST developer but, out of curiosity, a little search says this:
Quote:
'Array' is actually a foreign concept to CLIST. Building, maintaining, and handling an array in CLIST is a horrible chore for novices, and isn't much better for the old hands. The number-one problem is resolving the real name of the pseudo-array variable:
SET &ARRAY = &STR(&&ARRAY)
SET &INDEX = 1
SET &ARRAY&INDEX = &STR(THIS IS THE FIRST LINE)
The index must be separately maintained or be algorythmically reproducible in order to fetch the value later, each such element must be separately initialized, and the index value must have the appearance of a single token.

REXX, on the other hand, has 'associative array' as a native concept. That is, a REXX stem array can be indexed by any value: numbers, letters, words, sentences, anything:
ary. = '' /* initializes all ary.x empty */
indexval = "I have two blanks in a row"
ary.indexval = Length(indexval)

The stem array ARY. now has an element indexed by "I have two blanks in a row" which has a value of 27 (the length of "I have two blanks in a row"). The possibilities are endless.
drop ary. /* frees all storage associated with ary.x */
Back to top
View user's profile Send private message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Thu May 21, 2009 6:02 pm
Reply with quote

Thanks Anuj, really helped me a lot...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu May 21, 2009 6:09 pm
Reply with quote

You're welcome, hope you are making progress . . . icon_smile.gif
Back to top
View user's profile Send private message
aditi panse

New User


Joined: 19 May 2009
Posts: 9
Location: Poona

PostPosted: Tue Jun 02, 2009 12:53 pm
Reply with quote

Hi Anuj,


Thanks for your previous reply. I have used compound variable as array.
I am trying to send values in this variable to another CLIST (using nested CLIST). I have used PROC statement to pass the values. However I am not able to pass the values properly, each time I call another CLIST program asks for POSITIONAL PARAMETER.

Please could you let me know how I can send variable value directly to the CLIST.

I hope my query is clear.

Thanks,
Aditi
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts Same command as on commandline in REX... TSO/ISPF 6
No new posts How to move values from single dimens... COBOL Programming 1
Search our Forums:

Back to Top