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

Need to get values which are diff b/w 2 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ganesh_al

New User


Joined: 06 Sep 2006
Posts: 1
Location: USA

PostPosted: Thu Sep 22, 2011 1:56 am
Reply with quote

Hi

here is my requirement..! I have two files in hand.. I want to compare these two files and get a report as output which should show the key - followed by value which is different in file1 and value in file2.

Here is the example:
File 1 data
123ABC 123456
123DEF 123789

File 2 Data
123ABC 123456
123DEF 123456

Here first 6 characters are key. Followed by that I have data..
Now I wish to have my output as - Key - followed by first file's data which was different and then second file data's which was different..
123DEF 789 456
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 22, 2011 4:05 am
Reply with quote

You show only one example with different data. I can think of many different variations but you haven't given clear rules for all of those variations. It also isn't clear if you're comparing the two files key by key or record by record, or whether you have duplicate records within a file?

Here are some other possible input examples that you haven't covered - there are many more.

Code:

file1
123ABC 123456
123DEF XY345Z
123XYZ 123456
123XYZ 567890
123ZZZ 123456

file2
123ABC 153537
123DEF QR345S
123XYZ 123456
123XYZ ABCDEF
123YYY 123456


You would need to a much better job of explaining the rules for getting from input to output for all variations before anyone can help you. But I suspect you won't be able to do what you want with DFSORT since it can't show the difference in records at specific positions.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 22, 2011 4:13 am
Reply with quote

ganesh_al,

It looks more like what you want is a file-comparison utility. Find out what you have available, look at the manuals, try it out.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Sep 22, 2011 3:30 pm
Reply with quote

Hi, Welcome...

With examples you have shown, one might think you are matching chunks of 3 characters at a time like 123 with 123, 789 with 456...

Show the expected output for example shown by Frank.

What is LRECL\RECFM of input files

What is sort product installed at your shop?
(If you are not aware how to find .. Follow link ibmmainframes.com/viewtopic.php?t=33389 )
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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
Search our Forums:

Back to Top