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
 
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: 77
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: 7314

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 Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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