Author: juares castro
Subject: Joinkeys with duplicated keys
Posted: Fri Sep 23, 2016 5:58 am (GMT 5.5)
Hi everyone!
I am trying do a joinkey in SYNCSORT with duplicated keys in both INfiles. Actually in this example we have identical files talking about keys:
pos. 4 length 3.
Here input files:
SORTJNF1
SORTJNF2
Using the code below:
we have the file below:
SORTOF01
As we can see we got duplicated records in SORTOF01. Records # 4, 5, 6, 8, 9 and 10 are duplicated.
I mean the result i would like have is:
SORTOF01
Please, how could i code SYNCSORT avoiding duplicated records?
Thanks in advance!
Coded'd
_________________
Thanks!
juares castro
Subject: Joinkeys with duplicated keys
Posted: Fri Sep 23, 2016 5:58 am (GMT 5.5)
Hi everyone!
I am trying do a joinkey in SYNCSORT with duplicated keys in both INfiles. Actually in this example we have identical files talking about keys:
pos. 4 length 3.
Here input files:
SORTJNF1
Code: |
001111AAA 002222BBB 003333AAA 004333BBB 005333CCC 006444DDD |
SORTJNF2
Code: |
001111AAA 002222BBB 003333111 004333222 005333333 006444DDD |
Using the code below:
Code: |
JOINKEYS FILE=F1,FIELDS=(4,3,A) JOINKEYS FILE=F2,FIELDS=(4,3,A) JOIN UNPAIRED,F1,F2 REFORMAT FIELDS=(?,F1:1,9,F2:1,9) SORT FIELDS=COPY OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'B'),BUILD=(2,18,62X) |
we have the file below:
SORTOF01
Code: |
001111AAA001111AAA 002222BBB002222BBB 003333AAA003333111 003333AAA004333222 003333AAA005333333 004333BBB003333111 004333BBB004333222 004333BBB005333333 005333CCC003333111 005333CCC004333222 005333CCC005333333 006444DDD006444DDD |
As we can see we got duplicated records in SORTOF01. Records # 4, 5, 6, 8, 9 and 10 are duplicated.
I mean the result i would like have is:
SORTOF01
Code: |
001111AAA001111AAA 002222BBB002222BBB 003333AAA003333111 004333BBB004333222 005333CCC005333333 006444DDD006444DDD |
Please, how could i code SYNCSORT avoiding duplicated records?
Thanks in advance!
Coded'd
_________________
Thanks!
juares castro