MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Any better way- Fine tune the Job to Remove Dups

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
b540glenn
Beginner


Joined: 05 Oct 2005
Posts: 5
Topics: 3
Location: Near Detroit

PostPosted: Wed Oct 05, 2005 3:10 pm    Post subject: Any better way- Fine tune the Job to Remove Dups Reply with quote

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.
_________________
Glenn
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Wed Oct 05, 2005 3:16 pm    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
b540glenn
Beginner


Joined: 05 Oct 2005
Posts: 5
Topics: 3
Location: Near Detroit

PostPosted: Thu Oct 06, 2005 2:22 pm    Post subject: Reply with quote

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.
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group