I have been working around this since Friday, can't seem to get around it. Let me present my case again. I have over 232million observations. I need to categorize my IDs into 3 groups. Namely Whyz, Emfy and Pheno based on codes which an ID has in hltcode. ID's have more than one observations for hltcode. If an ID have only one of the following codes (35, 37, 38, 39, 484, 7827, 2728, 2539, 2218, 2721912) in hltcode then it is Whyz. If an ID have only one of the following codes (728, 7298, 722, 27218, 2721821, 27282, 27218) in hltcode then it is Emfy. However if an ID have both Whyz code AND Emfy code in hltcode then that ID needs to categorized as Pheno. Also, If any ID have any of these codes (637383, 35363, 9830) then that ID also have to be categorized as Pheno. Now, there are other 5 groups, called Klig, Uttr, Thaip, Ghait, Dondj the hltcode for Klig are (6373, 3633, 73392, 11928, 638383, 362892, 3691101) Uttr are (7748, 373229, 372382, 363763, 36373) Thaip are (872920,647474, 3731738, 646) Ghait are (77747, 6377, 36787, 46478498, 738991) Dondj are (7733, 63599, 37383, 3663, 37137) if any ID have a hltcode for Whyz AND Klig then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Whyz AND Klig AND Dondj then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Whyz AND Thaip AND Dondj then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Emfy AND Thaip then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Emfy AND Utter AND Thaip then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Emfy AND Dondj AND Thaip then that ID also have to be categorized also as Pheno. if any ID have a hltcode for Emfy AND Klig AND Dondj then that ID also have to be categorized also as Pheno. This was what i tried doing but realized that was not appropriate based on suggestions in SAS community. libname obs_rad "C:\obs_rad"; data obs_rad.radft; set obs_rad.radft; data obs_rad.SOB; set obs_rad.radft; if hltcode in (262, 2727, 26252, 227272) then alc_grp="Whyz"; if hltcode in (626228, 227, 22772, 26252, 7383) then alc_grp="Emfy"; if hltcode in (637383, 35363, 9830) then alc_grp="Pheno"; if hltcode in (636, 6363, 4484, 37393, 383839, 393, 3737) and hltcode in (636, 2262, 2627, 26272) then alc_grp="Pheno"; if hltcode in (262, 2727, 26252, 227272) and hltcode in (636, 6363, 4484, 37393, 383839, 393, 3737) and hitcode in 636, 2262, 2627, 26272) then alc_grp="Pheno"; proc freq data=obs_rad.SOB; table alc_grp; run;
... View more