View previous topic :: View next topic |
Author |
Message |
sivasankaric Beginner
Joined: 19 Aug 2008 Posts: 4 Topics: 3
|
Posted: Wed Aug 20, 2008 10:54 am Post subject: REXX - ARRAY concept in REXX |
|
|
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 |
|
 |
IEFBR14 Beginner

Joined: 13 Aug 2008 Posts: 17 Topics: 0 Location: SYS1.LINKLIB
|
Posted: Wed Aug 20, 2008 11:23 am Post subject: |
|
|
Not an array as such - but much more powerful - read up on stem variables |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Aug 21, 2008 3:52 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Aug 21, 2008 4:18 am Post subject: |
|
|
expat,
aren't you the "cat's pajamas"
good post, hope the OP understands. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
sivasankaric Beginner
Joined: 19 Aug 2008 Posts: 4 Topics: 3
|
Posted: Thu Aug 21, 2008 9:27 am Post subject: |
|
|
Thank You All |
|
Back to top |
|
 |
|
|