Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare Tables in cobol

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

New User


Joined: 02 May 2008
Posts: 72
Location: chennai

PostPosted: Thu Feb 23, 2012 6:16 pm    Post subject: Compare Tables in cobol
Reply with quote

Hi,

I need to compare three tables in cobol

Table 1- All the rc-id with date and amount
Table 2- Only the rc-id equal to 250 and its corresponding date,amount
Table 3- Only the rc-id equal to 251 and its correspodning date,amount

I need to read table 1 and write it when the rc-id not equal to 250 or 251
when it read 250 then i need to do compare with the table 3
If the date and amount in 250 matches the 251 record in table 3 then need to skip it else i need to write it

similarly,When it hits the 251 record then i need to compare it vice versa with the table 2 having 250 records
If the date and amount in 251 matches the 250 record in table 2 then need to skip it else i need to write it

How do we do this in cobol.

Also when decaring the table i tried like

01 WS-x1-TABLE.
05 WS-x1-RECORD OCCURS 1 TO 2000 TIMES
DEPENDING ON WS-x1-CTR.
10 WS-rcd-ID PIC 9(3).
10 WS-x1-CD PIC X.
is it necessary to use indexed by or just this will do.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Feb 23, 2012 6:40 pm    Post subject: Reply to: Tables in cobol
Reply with quote

Why an ODO?

Does you site use indexes? If yes, use them, if not, don't.

As to how to do it, sit down and think first. Do a bit of pseudo-code. Get it working. Implement it in Cobol.
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us