Gururajan Balaji
New User
Joined: 10 Jan 2011 Posts: 6 Location: Chennai
|
|
|
|
Hi,
I need to compare 2 files on first 5 bytes and get the matching records, both has duplicates in the key.
I don't want a cartesian product in the output. I need to do one to one matching. Since i use SYNCSORT i am unable to use NOSEQCK . Could some one help me accomplish this using SYNCSORT.
Basically I need 3 bytes starting from Position 6 of the second file to be replaced with 3 bytes from position 6 of the first file.
Sample Input File1: RECFM: FB, LRECL: 80
Code: |
XXXXX999CHENNAI...
XXXXX123SALEM....
YYYYY445MUMBAI...
YYYYY678DELHI...
|
Sample Input file2: RECFM: FB, LRECL: 80
Code: |
XXXXX001BANGLORE.....
XXXXX657SURAT.....
YYYYY978SIMLA....
ZZZZZ000HYDERABAD.....
|
Expected Output: RECFM: FB, LRECL: 80
Code: |
XXXXX999BANGLORE....
XXXXX123SURAT....
YYYYY445SIMLA....
|
Please find the sort card i used
Code: |
JOINKEYS FILE=F1,FIELDS=(1,5,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(1,5,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F2:1,80,F1:6,3)
OUTREC FIELDS=(1,5,81,3,9,71)
SORT FIELDS=COPY
|
This is the error message i got:
Code: |
SYNCSORT FOR Z/OS 1.3.2.0R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 16C35, MODEL 2097 708 LICEN
SYSIN :
JOINKEYS FILE=F1,FIELDS=(1,5,A),SORTED,NOSEQCK
*
JOINKEYS FILE=F2,FIELDS=(1,5,A),SORTED,NOSEQCK
*
REFORMAT FIELDS=(F2:1,80,F1:6,3)
OUTREC FIELDS=(1,5,81,3,9,71)
SORT FIELDS=COPY
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
WIll always the second file have lesser number of duplicates? Show an example input and the expected output when there are,
1) 3 duplicate keys in file-2 and you have 2 duplicates in file-1
2) 3 duplicate keys in file-2 and no duplicates in file-1
3) 3 duplicate keys in file-2 and no key present in file-1
btw NOSEQCK is a DFSORT option, you may not be able to use it in Syncsort. |
|