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
 

 

Identifying common records in two files

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

New User


Joined: 24 Feb 2011
Posts: 15
Location: India

PostPosted: Thu Jun 02, 2011 5:46 pm    Post subject: Identifying common records in two files
Reply with quote

Hi Guys. Suppose I have two files

File A
1
2
3
4

File B
2
3
4
5
6

How can i use DFSORT to identify the common records in these two ?

Could anyone help me on this issue?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jun 02, 2011 6:36 pm    Post subject:
Reply with quote

Is it a homework? Have you searched DFSORT part of the forum... ???
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jun 02, 2011 7:18 pm    Post subject:
Reply with quote

You can use JOIN KEYS
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jun 02, 2011 11:00 pm    Post subject:
Reply with quote

Musab Razeen Ahmed,

You could use a DFSORT JOINKEYS job like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input fileA
//IN2 DD DSN=...  input fileB
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(1,1,A),SORTED
  JOINKEYS F2=IN2,FIELDS=(1,1,A),SORTED
  REFORMAT FIELDS=(F1:1,80)
  OPTION COPY
/*


Alternatively, assuming there are no duplicates within each file and they have the same RECFM and LRECL, you could use the SELECT operator of DFSORT's ICETOOL like this:

Code:

//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input fileA
//    DD DSN=...  input fileB
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,1,CH) FIRSTDUP
/*


In either case, the output file would have:

Code:






If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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 split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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