View previous topic :: View next topic
|
Author |
Message |
arun85
New User
Joined: 09 Oct 2006 Posts: 10
|
|
|
|
Hi, I have designed a REXX program where there is a 2-D variable for Retail where it will have four fields like SNo, Item, Quantity and Rate. Now when I define it, I used the stem as R.I.Sno, R.I.Item etc. Where First Stem R denotes a grouping of a single Item's Details. I denotes a value where it just used for Incrementing to store the consecutive records needed to store and Sno, Item, Rate etc are the main fields which has certain Values.
Now when i Use SAY with R.I.SNo, R.I.Item, the output gets displayed as say 1, Rice etc... Now when i try to write each record in a PS using the REXX command, "EXECIO * DISKW OUTDD (STEM R." and check in File, it is not getting written. My idea was to write each record in the PS which should have all the four fields SNo, Item, Quantity and Rate and not want to write each field in next records. So I tried to group it. Can anyone help me on what command should i give in REXX to get what I require? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It may be helpful if you post your code so that we can see what your are doing for ourselves. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
There is no way of writing a two-dimensional array directly using EXECIO. You will have to create a new array (a simple loop-within-a-loop) and write this new array to your dataset.
O. |
|
Back to top |
|
|
arun85
New User
Joined: 09 Oct 2006 Posts: 10
|
|
|
|
I too got same kind of Information that we can't write a 2-D array variable in a file. Instead he suggested me to use concatenation operator to append all those values and write that single stem variable. I did like this.
E.i = S.I.Sno + S.I.Item + S.I.Qty + S.I.Rate
then writing E. using Execio command and it worked fine as i needed. Can i know why rexx doesn't allow to write 2-D variable. Also I have one more doubt. I am assigning a value to each index of a stem variable say E.1, E.2 etc. Say i didn't assign a value for E.3 but the values are assigned for E.1, E.2, E.4 & E.5 etc. Now when I display the values, I could see except E.3 all the values assigned are displayed as E.3 alone gets displayed as E.3. But when i use the stem to write in a File using command
Execio * Diskw ddname(Stem E.)
I could find in my file, only the first 2 records gets written and the next set of records E.4, E.5 (which i thought should be written) is not written in the file. Can you tell me why it happens. Also If i try to assign values to each index without interruption, i could see it gets written in the sequence. Thanks in Advance. |
|
Back to top |
|
|
|