View previous topic :: View next topic |
Author |
Message |
rajkumar_1981 Beginner
Joined: 05 Jan 2007 Posts: 5 Topics: 4
|
Posted: Mon Mar 17, 2008 11:11 pm Post subject: either sort or program? |
|
|
I need to compare the two input file. The output file should contain only first file of records and ommit the records which are present in both files.
for example
file 1:
------
1234
567
23456
234
file 2:
------
1234
23456
6789
output file:-
-------------
567
234 |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Mar 18, 2008 8:04 am Post subject: |
|
|
Is it important to keep the original sequence of records? _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Mar 18, 2008 9:52 am Post subject: |
|
|
rajkumar_1981,
what is the pattern of picking the records? Why didn't you pick 6789 record from file2? it does not have a matching record in file1
1. What is the LRECL and RECFM of the input and output files
2. Does any file contains duplicates
3. Do you need to retain the original sequence of records? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
amargulies Beginner
Joined: 10 Jan 2007 Posts: 123 Topics: 0
|
Posted: Tue Mar 18, 2008 3:31 pm Post subject: Re: either sort or program? |
|
|
rajkumar_1981 wrote: | I need to compare the two input file. The output file should contain only first file of records and ommit the records which are present in both files. |
This SyncSort for z/OS JOIN application will produce your requested output:
Code: |
//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
1234
567
23456
234
//SORTJNF2 DD *
1234
23456
6789
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,5,A)
JOINKEYS FILES=F2,FIELDS=(1,5,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,5)
SORT FIELDS=COPY
/* |
_________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
|
|