View previous topic :: View next topic
|
Author |
Message |
hiabra79
New User
Joined: 27 Mar 2014 Posts: 1 Location: india
|
|
|
|
Hi i need help in reading a file using rexx. I want to read input file line by line and copy the words in an array. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Please tell the precise problem that you are having. Show code and data enclosed in Code tags to align them, a relevant portion of the trace, and the error message(s) including the message number(s). |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Or read up on EXECIO. You can do that in 3 statements including dataset (not file) allocation and free. Note that Rexx does not have arrays but stem variables. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
I don't know much about REXX but this is what I can suggest you to start with along with others,
Code: |
"ALLOC FI(LNAME) DA('MY.PS.READ') SHR"
"EXECIO * DISKR LNAME(STEM ARRAY. FINIS"
"FREE FI(LNAME)" |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Rohit,
I feel I just wasted my time posting my response the way I did. I could easily have done what you did but then it would just be cut and pasted and nothing learned.
If TS is keen then he will still go and read up on EXECIO and probably should as there is a very nice subtlety with EXECIO which makes reading the stem afterwards a doddle. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
Back to top |
|
|
|