Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Moving table data to a single line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Nirav721

New User


Joined: 11 Feb 2008
Posts: 53
Location: NJ

PostPosted: Tue Oct 21, 2008 8:48 pm    Post subject: Moving table data to a single line
Reply with quote

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
View user's profile Send private message

martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Tue Oct 21, 2008 9:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Nirav721

New User


Joined: 11 Feb 2008
Posts: 53
Location: NJ

PostPosted: Tue Oct 21, 2008 10:15 pm    Post subject: Reply to: Moving table data to a single line
Reply with quote

Hi Martin,

Thanks a lot..that is working!!
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Oct 22, 2008 1:59 pm    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am
No new posts How to list data set names with diffe... murali.andaluri CLIST & REXX 8 Thu Apr 12, 2018 11:33 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us