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
 

 

cobol file match logic help required

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

New User


Joined: 13 Oct 2003
Posts: 2

PostPosted: Sat Feb 07, 2009 8:06 am    Post subject: cobol file match logic help required
Reply with quote

Hi,
Could you please someone help me out to derive the below logic in cobol or either to solve this issue with the combination of sort and cobol.

In our project one of the program creates a change report. Basically do a match (typical cobol match logic) from the previous version of the insurance file and the current version of the insurance file.

find the below examle:

current file previous file

ACC-N0 SEC-NO ACC-NO SEC-NO
A A1,A2,A3 A A2
A A2 A A1
A B B1 B2 B3
B B1 C C1,C2
C C1 C C1
D D1 D D1

DO A MATCH IF THE ACCOUNT NUMBERS ARE MATCHING CHECK FOR THE SEC NUMBER MATCH

AS PER MY CURRENT LOGIC

F1 < F2
F1 IS ADDED

F1 = F2

IN MY CASE A=A SO LOOK FOR SEC NUMBER MATCH A1= A2

SO IT WRITES A1 ADDED AND A2 IS DELETED AND A3 IS ADDED

BUT COMES TO THE NEXT RECORD IT WRITES A2 ADDED AND A1 DELETED

F1 > F2
F2 IS DELETED

THE OUTPUT IS

A A1 ADDED
A A2 DELETED
A A3 ADDED
A A2 ADDED
A A1 DELETED

This is 100% wrong.
could you please help me to derive the logic.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Feb 07, 2009 8:50 am    Post subject:
Reply with quote

Hello,

Please re-post your data using the "Code" tag and the Preview feature to eusure proper alignment. Also, please use values that are not almost all the same (possibly using all numeric for the acc-no and alphas for the sec-no).

At/near the top of the COBOL part of the forum is working code that accomplishes a 2-file match/merge which is what i believe you want. Download the code and review it for use with your requirement.
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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


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