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

VB File comparison


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Wed Mar 30, 2022 11:45 am
Reply with quote

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

Active Member


Joined: 15 Aug 2015
Posts: 905
Location: Bamberg, Germany

PostPosted: Thu Mar 31, 2022 10:21 am
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Selecting the max value from a file. DFSORT/ICETOOL 3
No new posts Change history of vsam file. JCL & VSAM 3
No new posts Split large FB file based on Key coun... DFSORT/ICETOOL 4
No new posts EMPTY file check scenario JCL & VSAM 6
No new posts SORT deletes the SORTOUT file DFSORT/ICETOOL 8
Search our Forums:

Back to Top