Any better way- Fine tune the Job to Remove Dups
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Any better way- Fine tune the Job to Remove Dups Author: b540glennLocation: Near Detroit PostPosted: Wed Oct 05, 2005 3:10 pm
    —
There are many posts about removing duplicates and they helped me construct what I have now (Thank You Smile ).

None have the twist I am working on.

Here are the requirements:

I have to merge 8 lookup tables into 1 lookup table.
The tables consist of a value and description.
There can be no duplicates in the final list.
The desired output is a list of unique values and descriptions.
The twist is, the descriptions may be different and the differing descriptions must be written to a separate exceptions file.
We will use this exceptions file to update the "incorrect" descriptions for future extracts. The tables are updated regularly so this will be an ongoing process.

Example:
Value--- Description
ADSRRA ROUTINE ADMISSION/PHYSICIAN RE
ADSRRA ROUTINE ADMISSION/PHYSICIAN RE
ADSRRA ROUTINE ADMISSION/PHYS REFER
ADSRRA ROUTINE ADMISSION/PHYSICIAN RE

The entry for "ADSRRA ROUTINE ADMISSION/PHYSICIAN RE" should be written to the final output and the entry for "ADSRRA ROUTINE ADMISSION/PHYS REFER" should be written to the exceptions file.

Here is what I have so far. The value - pos 11-22. The description - pos 23-55.

Code:

//SELECT  EXEC PGM=ICETOOL,REGION=0M   
//        ...
//INDD1    DD DSN=LOOK1       
//             DD DSN=LOOK2       
//             DD DSN=LOOK3
...       
//             DD DSN=LOOK8       
//OUTDD1 DD DSN=ALLDUPS   
//OUTDD2 DD DSN=NODUPS   
//OUTDD3 DD DSN=LIST     
//OUTDD4 DD DSN=DIFFRENT 
//TOOLIN DD *                                       
  SELECT FROM(INDD1) TO(OUTDD1) ON(11,12,CH) ALLDUPS  * select list of all duplicate values
  SELECT FROM(INDD1) TO(OUTDD2) ON(11,12,CH) NODUPS  * select all unique values
  SELECT FROM(OUTDD1) TO(OUTDD3) ON(11,12,CH) FIRST  * select 1 from list of duplicate values
  SELECT FROM(OUTDD1) TO(OUTDD4) ON(11,45,CH) NODUPS  *select "incorrect" descriptions from list of duplicate values
//*
//* sort unique values into 1 list.
//*
//JS010     EXEC PGM=SORT,PARM='SIZE=MAX'        * DFSORT
//SORTIN DD DSN=NODUPS               
//   DD DSN=LIST                 
//SORTOUT   DD DSN=SORTED               
...
//SYSIN     DD *                                                 
  SORT FIELDS=(11,12,CH,A)                                       
//


Is there a better way to do this?

Thank you for any suggestions.

#2:  Author: kolusuLocation: San Jose PostPosted: Wed Oct 05, 2005 3:16 pm
    —
b540glenn,

Quote:

SELECT FROM(INDD1) TO(OUTDD1) ON(11,12,CH) ALLDUPS * select list of all duplicate values
SELECT FROM(INDD1) TO(OUTDD2) ON(11,12,CH) NODUPS * select all unique values



You can club these into 1 single select statement with the following

Code:

 SELECT FROM(INDD1) TO(OUTDD1) ON(11,12,CH) ALLDUPS DISCARD(OUTDD2)   


Kolusu

#3:  Author: b540glennLocation: Near Detroit PostPosted: Thu Oct 06, 2005 2:22 pm
    —
kolusu wrote:

You can club these into 1 single select statement with the following

Code:

 SELECT FROM(INDD1) TO(OUTDD1) ON(11,12,CH) ALLDUPS DISCARD(OUTDD2)   


Thanks, that saved some run time.



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group