View previous topic :: View next topic
|
Author |
Message |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Biswajit D wrote: |
[...]
file 1 with HEX ON(note the date in column 163 : 1120528)
[...]
file 2 - data at column 163 = 1120627
[...]
to conclude... I could not compare this file using FM with my layout... |
The data (date) is different, so it is nothing to to with using your record-layout. You need to check why there is a difference, the point of doing the compare, isn't it, to look for differences?
Isn't there any "masking" available? |
|
Back to top |
|
|
Biswajit D
New User
Joined: 17 Apr 2012 Posts: 50 Location: India
|
|
|
|
The whole point of starting this post was to find out this difference using FM. but since FM did not give me the comparison (i mean the field that has change in data), i compared using SuperC. I knew that there is difference somewhere in the record but was not sure of the byte position where there is change. .
it is for this reason (I suspect this would be a very common scenario that people would be facing), that I was looking out for any utility that would give me the byte position where data changes in the datasets being compared. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is fairly easy to code a program do the byte-by-byte compare and mark the differences. All you need is the input files defined as 1-byte arrays (in WS) and a third array of the same length for the "markers".
First, compare the entire record and if equal get the next records.
If not equal, loop thru both files byte-by-byte and moving a "marker" to the 3rd array at that position (i use an asterisk).
When the loop concludes, print all 3 lines (in hex preferably) and i'd suggest the output be written into a file or have the process terminate after some small number of differences found. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
I know FM can do exactly what you are trying to do. I know because I use it for the same thing.
The newest piece of info you stated was that there is a redefines in the layout. Are you saying the difference that you know exists is in the redefined area?
Here's where you are losing me: You insisted that the lengths were correct between the file and the copybook. Then you got "not selected" for the entire file. When you turned on the "ignore length" option, suddenly you see two records changed. THIS IS PROOF THAT THE COPYBOOKS ARE NOT THE SAME AS THE FILE.
With the PROOF in mind, take a closer look at the copybooks and the views you have created with them. Maybe the redefined area is smaller than the full record?? Maybe??
If you have different record layouts for different record types, you'll have to tell FM how to match them up with the copybook areas. |
|
Back to top |
|
|
Biswajit D
New User
Joined: 17 Apr 2012 Posts: 50 Location: India
|
|
|
|
FM compare is a really cool functionality...really really like it... although this time I did nt get my desired result (verified that the layout I used had too many redefines and also not correct in the sense that the byte that had changes was a FILLER )...
but still... if there would have been an option in FM that would only tell the byte where difference is....
whenever time permits...will code the byte-by-byte comparison program... Thanks Dick for the suggestion... |
|
Back to top |
|
|
|