Syncsort to compare two files

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
Shambu
Posts: 5
Joined: Tue May 12, 2020 11:56 am
Skillset: Cobol jcl db2
Referer: Google

Syncsort to compare two files

Postby Shambu » Tue May 12, 2020 12:32 pm

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


Code: Select all


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

enrico-sorichetti
Global moderator
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
Referer: www.ibmmainframes.com

Re: Syncsort to compare two files

Postby enrico-sorichetti » Tue May 12, 2020 1:03 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort


  • Similar Topics
    Replies
    Views
    Last post