Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

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