View previous topic :: View next topic
|
Author |
Message |
mvmadhavi
New User
Joined: 09 Nov 2006 Posts: 21
|
|
|
|
I have two files one with 100 records and 2nd one with 1000 records with a name field.
File A
AAAAA
CCCC
EEEEE... till 100 records
File B
AAAAA
BBBBB
CCCCC
DDDDD
EEEEEE
FFFFFF..till 1000 records.
I need to compare File A and File B and remove all Similar records from
File B.All 100 records in file A are also in file B.
Apart from using omit condition 100 times is there any other method?
Hope my question is clear. |
|
Back to top |
|
|
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
mvmadhavi,
Do you only have unique records in file A & in file B ?
Alain |
|
Back to top |
|
|
mvmadhavi
New User
Joined: 09 Nov 2006 Posts: 21
|
|
|
|
yes we have unique records in File A and B |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
mvmadhavi
Try this ICETOOl JCL, here assumtion is the Name(KEY) field is 10 characters. If it is not then you could change as per your requirement in ON(p,m,f), where
p=>starting position of the field
m=>length of the field
f=>format of the field
Code: |
//GETMATCH EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=File1
// DD DSN=File2
//OUT DD Output file
//TOOLIN DD *
SELECT FROM(IN1) TO(OUT) ON(1,10,CH) NODUPS
/*
//*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for assuming that FileA and FileB both have RECFM=FB and the same LRECL (if not, tell me the RECFM and LRECL of each input file).
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file1 (FB/n)
// DD DSN=... input file2 (FB/n)
//OUT DD DSN=... output file (FB/n)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,5,CH) NODUPS
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
mvmadhavi
New User
Joined: 09 Nov 2006 Posts: 21
|
|
|
|
Thank you very much for the answer.
Just another question is there any other way apart from using
icetool. is it possible using syncsort.
Madhavi |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
mvmadhavi
Change ICETOOL to SYNCTOOL and try |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Or
Try this SORT JOB
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1 (FB/LRECL=80)
// DD DSN=... input file2 (FB/LRECL=80)
//SORTOUT DD DSN=... output file (FB/LRECL=80)
//SYSIN DD *
SORT FIELDS=(1,10,CH,A)
INREC OVERLAY=(81:C'1')
SUM FIELDS=(81,1,ZD)
OUTFIL REMOVECC,INCLUDE=(81,1,ZD,LT,2),BUILD=(1,80)
/*
|
Assumption is Files are of LRECL=80 |
|
Back to top |
|
|
|