Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum 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

Moderator Emeritus


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

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 Undesired result while joining files. Khupe SYNCSORT 3 Tue Sep 22, 2020 8:05 pm
No new posts Dynamically read input files using BP... Srinivas B COBOL Programming 20 Sat Sep 05, 2020 1:48 pm
No new posts Compare two character variables Head ... Harold Barnes CLIST & REXX 3 Fri Aug 28, 2020 12:38 am
No new posts Sync logic between VSAM files and DB2... murali.andaluri COBOL Programming 9 Tue Aug 25, 2020 1:01 pm
No new posts REXX tool to extract all files starti... KeshavKunal CLIST & REXX 4 Tue Jul 21, 2020 3:43 pm

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