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

comparision of KSDS files&inserting indicator in each re


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

New User


Joined: 25 Jul 2008
Posts: 5
Location: pune

PostPosted: Thu Jul 31, 2008 12:12 pm
Reply with quote

Hi all,


I am having two KSDS files whose records i have to match and
according to certain conditions.


The files contains records like:-


file1:-

111 as mike
222 wet neal
333 of rober
444 yes thomas
555 newton



file2:-

888 why sam
222 wet neal
444 the tom
555 see kelvin
666 no gery

conditions:-

a). Account no.present in file1 and not in file2 be written to output with Insert indicartor as “I”.
b.) Account no.present in file2 and not in file1 will be written to output with Delete indicator as “D”.
c.) Account no.are same in both file1 and file2 but the Other Feilds differ than Ind will be compared. If the data is changed, then the record will be written to output with Update ind as “U”.
d.) Account no. present in both file1 and file2 and also the other feilds are same then the record will be ignored.


So now the output file should be like this :-


output file :-


111 as mike I
333 of rober I
444 yes thomas U
555 newton U
888 why sam D
444 the tom U
555 see kelvin U
666 no gery D


so this is my problem, that how can i get this output?

Help me out..


Thanks & Regards.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 31, 2008 3:11 pm
Reply with quote

check for the 'sticky' in the Mainframe COBOL forum for match-merge.

that is an example of logic to compare two files.
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Thu Jul 31, 2008 3:16 pm
Reply with quote

Hi Sahil,

Multiple file matches are a fairly common process requirement. Dick Scherrer has posted a "Sticky" titled "2-File Match/Merge sample code", at the top of the Mainframe COBOL forum, which contains an example. Study the example to get the basic logic. Then model and modify the code to meet your requirements. If you still have questions/problems, after you have attempted to code, compile, and test your program, please post them along with any pertinent detail info and we will be happy to help.

Rick
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top