View previous topic :: View next topic
|
Author |
Message |
sangee27
New User
Joined: 16 Mar 2007 Posts: 19 Location: Pune
|
|
|
|
Hi,
I have an input file of record length 900. My requirement is , i have to check for any duplicate records, based on the entire record.
If duplicate records are present i have to write that to a file and set a condition code of '04' so that an email will be sent regarding the duplicates.
I have used the following jcl:
Code: |
//STPU100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE1 DD DSN=filename
//NODUPS1 DD DSN=outfile
//DUPS1 DD DSN=dupfile
//TOOLIN DD *
SELECT FROM(INFILE1) TO(DUPS1) ON(1,900,CH) FIRSTDUP DISCARD(NODUPS1)
|
and writing the dupicates to the dups1 file.
Now could you please tell me how to proceed with setting condition code to 04 if there are duplicates. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Add the following DFSORT/ICETOOL operator after SELECT:
COUNT FROM(DUPS1) NOTEMPTY RC4
Note that you don't need DISCARD(NODUPS1) in the SELECT statement unless you want to keep the records that aren't written to DUPS1 for some reason. |
|
Back to top |
|
|
sangee27
New User
Joined: 16 Mar 2007 Posts: 19 Location: Pune
|
|
|
|
Thanks a lot Frank.
And regarding your note, yes i want to process those records which were not written to DUPS1 file. |
|
Back to top |
|
|
|