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

Compare 2 flat files using Syncsort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Tue Sep 22, 2015 9:27 pm
Reply with quote

Hello Everyone,
I have two input files F1 and F2, each having LRECL=80 and RECFM=FB
Now I need to compare them and if records matches on keys from both files then its fine.

but if the record is present only in one file, then we need to write those records in another file.


If record is only present in F1 then we need to write that on F3 and if the record is only present in F2 then we need to write that record on F4.

I am looking for possible options to implement this, Using Syncsort/Filemanager etc.

Input files

File 1
Code:
AAAAAAAAA
BBBBBBBBB
CCCCCCCCC
DDDDDDDDD
EEEEEEEEE
FFFFFFFFF
GGGGGGGGG



File 2
Code:
AAAAAAAAA
CCCCCCCCC
DDDDDDDDD
FFFFFFFFF
HHHHHHHHH
IIIIIIIII
JJJJJJJJJ
KKKKKKKKK



Required Output

File 3 : Records only in File 1
Code:
BBBBBBBBB
EEEEEEEEE
FFFFFFFFF
GGGGGGGGG


File 4 Records only in File 2
Code:
HHHHHHHHH
IIIIIIIII
JJJJJJJJJ
KKKKKKKKK


Thanks for any help!!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Tue Sep 22, 2015 9:46 pm
Reply with quote

It's a simple JOINKEYS. Lots of examples here and in the DFSORT forum and elsewhere (like manuals, search results).
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts exclude the 5 first lines for compare... TSO/ISPF 2
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Numeric check w/SyncSort. SYNCSORT 1
No new posts Last day of the month via SYNCSORT. SYNCSORT 5
Search our Forums:

Back to Top