Hello, Try using this code below, the issue might be that you would have to format them again as shown below. I hope it helps! ICD10a = SUBSTR(ICD10,1,3); IF ICD10a = 'I25' THEN CODCd = 1; ELSE IF ICD10a = 'I50' THEN CODCd = 2; ELSE IF ICD10a = 'I63' THEN CODCd = 3; ELSE CODCd = 4; IF CODCd IN(1, 2, 3) THEN HypRelDeathInd = 1; ELSE HypRelDeathInd = 0; DROP ICD10a; RUN; To get the formats as to how you mentioned in the second table, try using this: PROC FORMAT; VALUE CODCd 1 = "I25.XX" 2 = "I50.XX" 3 = "I63.XX" 4 = "Other COD"; RUN;
... View more