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
 

 

Compare two files, Not matched come out of comparision

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 20, 2014 12:31 pm    Post subject: Compare two files, Not matched come out of comparision
Reply with quote

Hi,
I have two files F1 and F2 and the files are 80 bytes of length and Fixed block. Both the files contains 5 bytes Employee number starting from 1st position.
My requirement is compare F1 and F2 on employee number and if there is a unmatching record then comeout of comparision and write F1 file. And if both the files matched, then don't write anything.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 20, 2014 12:44 pm    Post subject: Reply to: Compare two files, Not matched come out of compari
Reply with quote

why not search Yourself the forum
there are gazillions of examples/snippets that do just that.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue May 20, 2014 1:41 pm    Post subject:
Reply with quote

Search the forum on JOINKEYS
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Tue May 20, 2014 1:49 pm    Post subject: Reply to: Compare two files, Not matched come out of compari
Reply with quote

You want to compare two files on a key: if they are different, you want to write out the entire content of F1; if they are the same you don't want to do anything?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 20, 2014 2:50 pm    Post subject:
Reply with quote

Yes Bill. I want to compare two files on a key: if they are different, you want to write out the entire content of F1; if they are the same you don't want to do anything.
But here is the twist. I don't want to read all the records of F1. Suppose I have 100 records in F1 and 20 Records in F2. And First record of F1 don't have a matching key in the entire file of F2, then I don't want to process further. Come out of comparison (donot want to compare 2nd record of F1 with F2) and write F1 as it is.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Tue May 20, 2014 2:59 pm    Post subject: Reply to: Compare two files, Not matched come out of compari
Reply with quote

OK. Can't be done with SORT. You'll need a program then. If you say which language you'd like to use, I can move the topic.

Seems a strange requirement, but it is certainly a killer. Is it the case that most of the time the files will not match?

Just as a suggestion for your program, why bother to copy the F1? Why not just set a Return Code, and use the original F1 later as "the copy". Doesn't seem to be much point in a plain copy.
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 20, 2014 3:08 pm    Post subject:
Reply with quote

Thanks Bill. I was just enquiring is it possible in SORT or not. I will code it thru Cobol. That will be easy for me and will take care of your suggestion. Thanks again
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue May 20, 2014 3:12 pm    Post subject:
Reply with quote

And yes, most of the times the file will not match. No need to move it into COBOL forum
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 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
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm


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