MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to create an arrary or a table in CLIST?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Dhananjay G. Khandekar
Beginner


Joined: 25 Nov 2004
Posts: 1
Topics: 1
Location: Pune India

PostPosted: Thu Nov 25, 2004 2:15 am    Post subject: How to create an arrary or a table in CLIST? Reply with quote

Hi,

In CLIST following code is in loop till end of file is reached:

GETFILE MASTFILE
SET PROJARRAY&COUNTADD = &SUBSTR(1:17,&MASTFILE)
WRITE PROJARRAY&COUNTADD &PROJARRAY&COUNTADD &SUBSTR(1:17,&MASTFILE)
SET COUNTADD = &COUNTADD + 1

But the array is not stored and the out put is as below:
PROJARRAY1 1 00000000000000000
PROJARRAY2 2 HBAP0000000000000
PROJARRAY3 3 HBHK0000000000000
PROJARRAY4 4 HBMX0000000000000
PROJARRAY5 5 99999999999990000

Can you please let me know where I am going wrong? The similar logic is given in the manuals but it is not working in my CLIST.

I want to define an array and store the file keys into it.
Please, help!!
_________________
Regards, Dhananjay
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Nov 25, 2004 8:02 pm    Post subject: Reply with quote

This CLIST will demonstrate what you want. It will print the numbers from 0 - 98 that are stored in variables which resolve to the name ARRAY1, ARRAY2, etc...

PROC 0

SET INDEX = 0
SET VALUE = 0
SET VARIABLE = &&ARRAY&INDEX

HERE: SET ARRAY&INDEX = &VALUE

SET ARRAYVAL = &&ARRAY&INDEX
WRITE &ARRAYVAL

SET INDEX = &INDEX + 1
SET VALUE = &VALUE + 2

IF &VALUE < 100 THEN GOTO HERE

EXIT: EXIT

If I was you I'd forget CLIST and learn Rexx. For a short learning curve you will get a massive benefit. CLIST is a dead language and that only reason it is still around is to support people who refuse to stop using it.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group