View previous topic :: View next topic
|
Author |
Message |
ganesh_al
New User
Joined: 06 Sep 2006 Posts: 1 Location: USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
|