View previous topic :: View next topic
|
Author |
Message |
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
I have a requirement
There are 2 files with same layout each having the following fields in it.
1) Member ID (1-8) and (1 is the start pos, 8 end pos)
2) Member name (10-20)
I want to remove the records from the 1st file if the member ID in the 1st file is present in the 2nd file? i.e I want to extract only those records from 1st file to output file if it is not present in 2nd file...
Is this possible to achieve this using dfsort? please help |
|
Back to top |
|
|
Dsingh29
Active User
Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Dsingh... This is very old topic.. and solution based on DFSORT at that time..
Now it is much smarter than that time...
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//FILE1 DD *
MEMID001 AAAAAAAAAAAAAA
MEMID002 BBBBBBBBBBBBBB
MEMID003 CCCCCCCCCCCCCC
//FILE2 DD *
MEMID003 CCCCCCCCCCCCCC
MEMID004 DDDDDDDDDDDDDD
MEMID005 EEEEEEEEEEEEEE
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=FILE1,FIELDS=(1,8,A)
JOINKEYS F2=FILE2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1,ONLY |
Output will be..
Code: |
MEMID001 AAAAAAAAAAAAAA
MEMID002 BBBBBBBBBBBBBB
|
seahawk789Let us know if this satisfies your requirement... |
|
Back to top |
|
|
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
Thanks a lot guys..
Special thanks to 'Escapa' for a neat solution.. |
|
Back to top |
|
|
|