Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare 2 flat files using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Compare 2 flat files using Syncsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Sep 22, 2015 9:46 pm    Post subject: Reply to: Compare 2 flat files.
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us