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: 7309
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top