View previous topic :: View next topic
|
Author |
Message |
Nirav721
New User
Joined: 11 Feb 2008 Posts: 53 Location: NJ
|
|
|
|
Hi,
I have a table built with this:
01 TRN-UPD-TABLE.
05 MOD-UPD-TRN-RECORD OCCURS 100 TIMES INDEXED BY
MOD-UPD-TRN-INDEX.
10 TAB-MOD-UPD-TRN PIC X(4).
Now, what I would like to do is, read the contents of this table, one by one until 'spaces' is encountered..and when I am reading this, I would like to move its contents to an output line which can hold up to 5 of the items from this table (my output area designated for this is twenty bytes...)
Any thoughts?
Thanks!! |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
Hy Nirav721,
define an output area which is 20 bytes long (char)
when you encounter an index item which is equal 'spaces'
move TRN-UPD-TABLE to the newly defined output area,
that's all.
maybe you can solve this in any other way also...
regards,
martin9 |
|
Back to top |
|
|
Nirav721
New User
Joined: 11 Feb 2008 Posts: 53 Location: NJ
|
|
|
|
Hi Martin,
Thanks a lot..that is working!! |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Nirav,
You can also use redefine clause for this.
Code: |
01 MOD-UPD.
02 TRN-UPD-TABLE.
05 MOD-UPD-TRN-RECORD OCCURS 100 TIMES INDEXED BY
MOD-UPD-TRN-INDEX.
10 TAB-MOD-UPD-TRN PIC X(4).
02 REDEF REDEFINES TRN-UPD-TABLE PIC X(20) OCCURS 20 TIMES.
|
Here you can use REDEF for your output |
|
Back to top |
|
|
|