View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
prahalad
New User
Joined: 14 Sep 2010 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|