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

Comparex -- KEY SYNCHRONIZATION MISMATCH


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

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Tue Oct 02, 2012 11:44 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 02, 2012 11:55 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 03, 2012 12:56 am
Reply with quote

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
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Wed Oct 03, 2012 6:35 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Oct 03, 2012 11:37 am
Reply with quote

Yes.

Kolusu provided test data even. Did you run with that?
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Wed Oct 03, 2012 6:13 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Oct 03, 2012 6:21 pm
Reply with quote

What do you get when you run Kolusu's example AS IS? I got 2 records on SORTOUT.
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: Wed Oct 03, 2012 6:33 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 03, 2012 10:35 pm
Reply with quote

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
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 Mainframe to linux file count mismatch All Other Mainframe Topics 4
No new posts COMP Variables Mismatch COBOL Programming 5
No new posts Comparex utility to Syncsort conversion SYNCSORT 11
No new posts Record Extraction Mismatch from Header CLIST & REXX 3
No new posts mismatch between dfsrmm volume and SM... JCL & VSAM 3
Search our Forums:

Back to Top