I have 100,000 patients, each of which receives one of 116 diagnoses. I'm exploding the 116 diagnoses into 116 binary variables. Some of these diagnoses are rare, so I want to roll them up into an diagnosis that is much more prevalent, and pare down the list of 116 to around 30 common diagnoses. I'm using the code below to try to do that, but the %if condition always returns a FALSE. That should not be the case for patients with rare diagnoses. Do you know what is wrong with my code? Thanks! Andrew options minoperator; %macro aggdx(dxlist, rolled_up_dx); %if diagnosis in &dxlist %then &rolled_up_dx = 1; %mend; data hosp1; set hosp2; /* Example of what I want to do: if acidbase = 1 or comametu = 1 or diabetic = 1 then metamisc = 1; */ %aggdx(ACIDBASE COMAMETU DIABETIC, METAMISC) /* So I'll have about 30 calls to %aggdx, one for each of the common diagnoses */ ; run;
... View more