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 

REXX - ARRAY concept in REXX

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


Joined: 19 Aug 2008
Posts: 4
Topics: 3

PostPosted: Wed Aug 20, 2008 10:54 am    Post subject: REXX - ARRAY concept in REXX Reply with quote

Below rexx code will pick the string located in position 1 to 10 from each line from the input dataset and assign it to the Variable 'X' for display purpose.

I want to store the return result in a variable, say array variable, so that i can use all the output values for my future purpose.

Please advise how to store it in array. Thank You.

/* REXX */
INPT = "XXXXX.XXXX.XXXXX'
"ALLOC FI(IO) DA('"INPT"') SHR REU"
"EXECIO * DISKRU IO (STEM IO.)"
DO B = 1 TO IO.0
X = SUBSTR(IO.B,1,10)
END
SAY X
Back to top
View user's profile Send private message
IEFBR14
Beginner


Joined: 13 Aug 2008
Posts: 17
Topics: 0
Location: SYS1.LINKLIB

PostPosted: Wed Aug 20, 2008 11:23 am    Post subject: Reply with quote

Not an array as such - but much more powerful - read up on stem variables
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Aug 21, 2008 3:52 am    Post subject: Reply with quote

If you change your code to
Code:

DO B = 1 TO IO.0
  X.B = SUBSTR(IO.B,1,10)
END
x.0 = IO.0

It will build a stem variable as you go along.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Aug 21, 2008 4:18 am    Post subject: Reply with quote

expat,

aren't you the "cat's pajamas"

good post, hope the OP understands.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
sivasankaric
Beginner


Joined: 19 Aug 2008
Posts: 4
Topics: 3

PostPosted: Thu Aug 21, 2008 9:27 am    Post subject: Reply with quote

Thank You All
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