IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare Tables in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Thu Feb 23, 2012 6:16 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Feb 23, 2012 6:40 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top