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
 

 

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: 6966
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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