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
 
comparision of KSDS files&inserting indicator in each re

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: comparision of KSDS files&inserting indicator in each re
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: 6970
Location: porcelain throne

PostPosted: Thu Jul 31, 2008 3:11 pm    Post subject:
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    Post subject:
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    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 Change NULL indicator in UNLOAD utility Khadhar Basha DB2 2 Fri Dec 15, 2017 3:01 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am

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