View previous topic :: View next topic
|
Author |
Message |
anandbtech01
New User
Joined: 07 Feb 2022 Posts: 15 Location: INDIA
|
|
|
|
Hi,
I have 2 VB file of same length 284. I am comparing full length of records and trying to get matching and unmatching records using below sort.
Code: |
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(5,284,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(5,284,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,4,?,F1:5,284,F2:5,284)
OPTION COPY
OUTFIL FNAMES=UNMATCH1,INCLUDE=(5,1,CH,EQ,C'1'),
FTOV,BUILD=(6,284)
OUTFIL FNAMES=UNMATCH2,INCLUDE=(5,1,CH,EQ,C'2'),
FTOV,BUILD=(290,284)
OUTFIL FNAMES=MATCH,INCLUDE=(5,1,CH,EQ,C'B'),
FTOV,BUILD=(6,284,/,290,284)
/*
|
But i am not getting the expected result.
Input File 1 has 23 records
Input File 2 has 23 records ( Copied file and just changed 3 characters )
Code: |
IP FILE : 1
Ø DEALER 1235TEST DATAESE2
Ø DEALER O1234SAN JOSE FORD
Ø MODEL S FORD FOCUS
IP FILE : 2
Ø DEALER 1235TEST DATAESE2
Ø DEALER O1234XXX JOSE FORD
Ø MODEL S FORD FOCUS
|
In the above files 2nd line SAN has been changed to XXX.
Expected : If do comparison, in MATCH file is should get 22 lines and UMATCH files should get only 1 record
but i am getting in Match file 10 - records , UNMATCH1 - 13 records and UNMATCH2 - 13 records.
In 3.13 SRCHFOR for UNMATCH1 and UNMATCH2 - only 1 line is showing as different.
If so why sort is considering 13 lines as different ???? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=ICEMAN
//F1 DD DISP=OLD,DSN=&SYSUID..VB284.#1
//F2 DD DISP=OLD,DSN=&SYSUID..VB284.#2
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//UNMATCH1 DD SYSOUT=*
//UNMATCH2 DD SYSOUT=*
//MATCH DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=F1,FIELDS=(5,80,A),SORTED,NOSEQCK
JOINKEYS F2=F2,FIELDS=(5,80,A),SORTED,NOSEQCK
JOIN UNPAIRED
REFORMAT FIELDS=(?,F1:5,80,F2:5,80)
OUTFIL FNAMES=UNMATCH1,INCLUDE=(1,1,CH,EQ,C'1'),
FTOV,BUILD=(2,80)
OUTFIL FNAMES=UNMATCH2,INCLUDE=(1,1,CH,EQ,C'2'),
FTOV,BUILD=(82,80)
OUTFIL FNAMES=MATCH,INCLUDE=(1,1,CH,EQ,C'B'),
FTOV,BUILD=(2,80,/,82,80)
END
/* |
Intermediate Output:
Code: |
****** **************************** Datenanfang ************************
000001 BØ DEALER 1235TEST DATAESE2
000002 1Ø DEALER O1234SAN JOSE FORD
000003 2 ...
000004 BØ MODEL S FORD FOCUS
****** **************************** Datenende ************************** |
|
|
Back to top |
|
|
|
|