So do the combinations belong in code=6, or do they start a new category such as code=7? I'll use 7 for the sample code.
Starting with the first ELSE statement, turn each into two possibilities. I'll illustrate just one set of changes for one ELSE statement:
else if find (Race, "AfricanAmerican") then do;
if code=. then code=2;
else code=7;
end;
So each time you find a match, check whether CODE was already assigned by an earlier match.
... View more