Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7228

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 syncsort: copy lines after the keyword shreya19 SYNCSORT 6 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us