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
 

 

Matching 2 Files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Matching 2 Files
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    Post subject:
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 Moderator


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

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

M K K,

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

http://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    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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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