Page 1 of 1

Syncsort to compare two files

PostPosted: Tue May 12, 2020 12:32 pm
by Shambu
Hi,

I have two vsam files with an unique key at positions 1 to 10 at both the files.
I want to sort out all the records in file 2 which is matching with key value field in file 1.
FILE 1
XXXXXXXXXX A B C D
AAAAAAAAA P Q R S
YYYYYYYYYY D E F G
ZZZZZZZZZZ L M N O

FILE 2
XXXXXXXXX ABC DEF KLM
XXXXXXXXX GHO MNO QRS
XXXXXXXXX UVW XYZ ABC
YYYYYYYYY ABC MNO QRS
ZZZZZZZZZ PQR TUV LMN
ZZZZZZZZZ XYZ ABC TUV

Desired output

XXXXXXXXX ABC DEF KLM
XXXXXXXXX GHO MNO QRS
XXXXXXXXX UVW XYZ ABC
YYYYYYYYY ABC MNO QRS
ZZZZZZZZZ PQR TUV LMN
ZZZZZZZZZ XYZ ABC TUV

Could someone please help me to write a sort card for this.


coded for You so that You can see how it easier to understand the data



FILE 1
XXXXXXXXXX  A  B  C   D
AAAAAAAAA   P  Q  R  S
YYYYYYYYYY  D  E  F  G
ZZZZZZZZZZ  L  M  N  O

FILE 2
XXXXXXXXX  ABC DEF KLM
XXXXXXXXX  GHO MNO QRS
XXXXXXXXX  UVW XYZ ABC
YYYYYYYYY  ABC MNO QRS
ZZZZZZZZZ  PQR TUV LMN
ZZZZZZZZZ  XYZ ABC TUV

Desired output

XXXXXXXXX  ABC DEF KLM
XXXXXXXXX  GHO MNO QRS
XXXXXXXXX  UVW XYZ ABC
YYYYYYYYY  ABC MNO QRS
ZZZZZZZZZ  PQR TUV LMN
ZZZZZZZZZ  XYZ ABC TUV

Re: Syncsort to compare two files

PostPosted: Tue May 12, 2020 1:03 pm
by enrico-sorichetti
asked and replied gazillions of times , search the forum or look at

https://www.ibm.com/support/pages/smart-dfsort-tricks

even if the paper was written for IBM DFSORT , most of the suggestions are valid also for SYNCSORT

when You post data use the code tags, it makes thing easier for people who spend their time helping