IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Matching 2 Files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Oct 04, 2010 4:24 pm
Reply with quote

Dear Expert,

I have 2 files.

File 1 is a Master File which contains the Key field locates @ position 13 and its length is 20 characters.

File 2 is an extract file from other source, where the Key fields locates @ position 190 and key length is 20 characters.

Both the files should process thru a single programs which take only the Key field from both the files.

I would like to write a SORT card, such that,
Take Key from File 2 and search for its existence in File 1
If it finds, I would like to remove it,
If not found write the record onto temporary file and then send it as an input to the above said program.


As the File 2 contains millions of records, it is wise enough to remove the unnecessary records before it goes thru the program.

Please provide me the SORT card for this...
Back to top
View user's profile Send private message
prahalad

New User


Joined: 14 Sep 2010
Posts: 18
Location: Pune

PostPosted: Mon Oct 04, 2010 5:15 pm
Reply with quote

You can use the following sort for this:

Code:

//STPU080   EXEC PGM=SORT                       
//SORTJNF1  DD DSN=FILE1NAME,...                         
//SORTJNF2  DD DSN=FILE2NAME,...                       
//SORTOUT   DD DSN=OUTPUTFILENAME,...                   
//SYSIN     DD *                                 
  JOINKEYS FILES=F1,FIELDS=(13,20,A)             
  JOINKEYS FILES=F2,FIELDS=(190,20,A)             
  JOIN UNPAIRED,F2,ONLY                           
  SORT FIELDS=COPY                               
//SYSOUT   DD SYSOUT=*                           
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Oct 05, 2010 12:19 am
Reply with quote

M K K,

For complete details on DFSORT's JOINKEYS function, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top