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
 

 

Comparison of 2 files using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ramya Ganesan

New User


Joined: 24 Sep 2013
Posts: 5
Location: India

PostPosted: Fri Oct 04, 2013 11:41 am    Post subject: Comparison of 2 files using DFSORT
Reply with quote

Hi,

My requirement is to compare two input files of same length(65 bytes). I need to compare the files using DFSORT and generate two output files with the length similar to that of input files length.

Desired output is:
One file should contain the matched rows and the other with the unmatched rows. Please help. It is urgent.

P.S: There are no key fields.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Oct 04, 2013 12:29 pm    Post subject:
Reply with quote

Hi Ramya,

If there are no key fields so do you want to compare the whole record?
Back to top
View user's profile Send private message
Ramya Ganesan

New User


Joined: 24 Sep 2013
Posts: 5
Location: India

PostPosted: Fri Oct 04, 2013 12:39 pm    Post subject:
Reply with quote

Hi,

Yeah, I need the whole record to be comapred.
Back to top
View user's profile Send private message
lakshmikondur

New User


Joined: 05 Jan 2006
Posts: 9
Location: hyderabad

PostPosted: Fri Oct 04, 2013 12:48 pm    Post subject: Reply to: Comparison of 2 files using DFSORT
Reply with quote

This can be achieved by using Join keys in sort

Control card For matching records.
Code:
JOINKEYS FILE=F1,FIELDS=(1,65,A)
JOINKEYS FILE=F2,FIELDS=(1,65,A)
REFORMAT FIELDS=(F1:1,65)
SORT FIELDS=COPY


Control card For non-matching records.
Code:
JOIN UNPAIRED, F1, ONLY
JOINKEYS FILE=F1,FIELDS=(1,65,A)
JOINKEYS FILE=F2,FIELDS=(1,65,A)
REFORMAT FIELDS=(F1:1,65)
SORT FIELDS=COPY


Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Fri Oct 04, 2013 1:44 pm    Post subject: Reply to: Comparison of 2 files using DFSORT
Reply with quote

It can be done in one step, of course.

Ramya Ganesan,

Sorry, but you are getting paid, we are not. Urgent for you therefore means nothing to us.

We are not trying to be cruel by this, it is just we answer when time allows.

There are lots of examples here of what you want. You need to be clear about what unmatched records you want. If you put unmatched from both files on the same output, you won't know where they have come from.
Back to top
View user's profile Send private message
Ramya Ganesan

New User


Joined: 24 Sep 2013
Posts: 5
Location: India

PostPosted: Fri Oct 04, 2013 2:38 pm    Post subject:
Reply with quote

Hi Lakshmi,

Thank you for piece of code.The matching records are giving me duplicates(it is repeating every record twice).

Hi Bill,

I just need matched records in one file and unmatched in the other without duplicates. Does not really matter which file they come from. Pls let me know if I am not clear. Single step would be great.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Fri Oct 04, 2013 3:00 pm    Post subject: Reply to: Comparison of 2 files using DFSORT
Reply with quote

Code:
JOIN UNPAIRED,F1,F2
JOINKEYS FILE=F1,FIELDS=(1,65,A)
JOINKEYS FILE=F2,FIELDS=(1,65,A)
REFORMAT FIELDS=(F1:1,65,F2:1,65,?)
SORT FIELDS=COPY

OUTFIL FNAMES=MATCH,INCLUDE=(131,1,CH,EQ,C'B"),BUILD=(1,65)
OUTFIL FNAMES=NOMAT,SAVE


Untested. I must have a sticker saying "Chump" stuck on me somewhere.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 04, 2013 6:15 pm    Post subject:
Reply with quote

Check the smart DFSORT trick "Create files with matching and non-matching records" here

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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