|
View previous topic :: View next topic
|
| Author |
Message |
Elixir
Active User

Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Hi,
Im using comparex for comparing the Unloads of DB2 Table.
The Key field is 1 to 57. There is a Binary field in the 36 position of 2 bytes (S9(04) Comp) which im Masking for comparing the unloads.
The total record count of both unloads match, but in the output im Getting "KEY SYNCHRONIZATION MISMATCH".
I sorted both the unloads before compasion on (1,57,CH,A).
Comparex Sysin is as below,
KEY=(01,57)
MASK=(36,2)
COPYDIFF
Please let me know if there is a Masking Used in the key field, the comparex would throw such error or there are mismatches. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You do realize that Comparex is not part of the DFSORT product (unless i missed the memo)?
| Quote: |
| Please let me know if there is a Masking Used in the key field, the comparex would throw such error or there are mismatches. |
What does the Comparex documentation say? |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Elixir,
As dick scherrer pointed out, Comparex utility is not related to DFSORT. However here is an equivalent DFSORT JCL which will give you the desired results based on your comparex control cards.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
RECORD00000000000000000000000000001NOAAAAAAAAAAAAAAAAAAAA
RECORD00000000000000000000000000002NNBBBBBBBBBBBBBBBBBBBB
RECORD00000000000000000000000000003NBCCCCCCCCCCCCCCCCCCCC
//INB DD *
RECORD00000000000000000000000000001NOAAAAAAAAAAAAAAAAAAAA
RECORD00000000000000000000000000004NNBBBBBBBBBBBBBBBBBBBB
RECORD00000000000000000000000000005NBCCCCCCCCCCCCCCCCCCCC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,35,A,38,20,A)
JOINKEYS F2=INB,FIELDS=(1,35,A,38,20,A)
JOIN UNPAIRED,F2,ONLY
//* |
|
|
| Back to top |
|
 |
Elixir
Active User

Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Thanks very much skolusu.
I ran using the following control card and the sortout is empty.
Does it mean that all the fields in both the files except column 36 and 37 are equal. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes.
Kolusu provided test data even. Did you run with that? |
|
| Back to top |
|
 |
Elixir
Active User

Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
the record length of my files being compared are 738
below is the control card i used
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,35,A,38,701,A)
JOINKEYS F2=INB,FIELDS=(1,35,A,38,701,A)
JOIN UNPAIRED,F2,ONLY
I got sortout empty |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| What do you get when you run Kolusu's example AS IS? I got 2 records on SORTOUT. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Elixir wrote: |
the record length of my files being compared are 738
below is the control card i used
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,35,A,38,701,A)
JOINKEYS F2=INB,FIELDS=(1,35,A,38,701,A)
JOIN UNPAIRED,F2,ONLY
I got sortout empty |
As has been suggested, run with test data.
With the above, if you have a records on INA which are "surplus" they are ignored. All records on INB match to a record on INA. If you look at the Sysout, you'll see record counts. Are they they same?
If your 1,35 makes a unique key, and the data is in order, you wouldn't need the default Sort that is happening. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| Elixir wrote: |
Thanks very much skolusu.
I ran using the following control card and the sortout is empty.
Does it mean that all the fields in both the files except column 36 and 37 are equal. |
NO. I gave DFSORT equivalent control cards for your comparex control cards. If you got an empty sortout, it doesn't mean that both files are equal, it just means that INB file does not have any extra records that don't match with records in INA file. If you had ran the sample JCL I gave you would have noticed that it did not write the mismatched records from INA file.
| Elixir wrote: |
the record length of my files being compared are 738
I got sortout empty |
In your initial post you mentioned that the key is only 57 bytes, now how did it dramatically increase to 738 bytes? Is this a entirely a new requirement ? If you want to compare the full 738 bytes why are your comparex control cards only checking for 57 bytes as key? |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|