Joined: 05 Oct 2005 Posts: 5 Topics: 3 Location: Near Detroit
Posted: Wed Oct 05, 2005 3:10 pm Post subject: Any better way- Fine tune the Job to Remove Dups
There are many posts about removing duplicates and they helped me construct what I have now (Thank You ).
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. _________________ Glenn
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum