Dear Cspro team
I need some assistance how remove duplicate value sets. I have external dictionary which is used to select household from it.The same household may be available in that external dictionary, but I used it for lookup to another applications for household selections, but appears more than one's times or doubled but I want only one.
I used the below functions, it works but the valuesets are Moren thanm Please help
Thank you
PROC TPMHHID
preproc
ValueSet Tempohh_vs;
forcase CROPSELECTED_DICT where SENUMID = TPENUMID do
//
Tempohh_vs.add(SHHNAME, SHH_ID);
enddo;
Tempohh_vs.sort();
setvalueset($, Tempohh_vs);
Remove Duplicate valuesets
Remove Duplicate valuesets
- Attachments
-
- Valuesets.jpg (122.47 KiB) Viewed 8273 times
-
- Posts: 1851
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Remove Duplicate valuesets
When you are building your value set, you can check if a code has already been added and then only add it if that has not happened:
if Tempohh_vs.codes.seek(SHH_ID) = 0 then
Tempohh_vs.add(SHHNAME, SHH_ID);
endif;
Tempohh_vs.add(SHHNAME, SHH_ID);
endif;
Re: Remove Duplicate valuesets
Thank you, Gregory, for your help the code you sent is solved my issues on duplicate value sets.