Hello everyone,
Please, I want to get patients with type II diabetes by subtracting those with Type I diabetes from the total patients with diabetes (the general code for diabetes is 250 but sub-types are identified by the last 2 digits). I am doing this because the coding for type I is more correct than type 2 and I was instructed to do so. My code doesn't work probably because I
DATA MYHUMANA.MED_DIAG;
SET MYHUMANA.MED;
T2D = 0; /**a new variable for type II diabetes**/
ARRAY DIAG (*) ADMISSION_DIAGNOSIS_CODE MEDICAL_PRIMARY_DIAGNOSIS_CODE MEDICAL_DIAGNOSIS_CODE_2 - MEDICAL_DIAGNOSIS_CODE_9;
DO I = 1 TO 10;
IF SUBSTR (DIAG(I),1,3) IN ('250') AND SUBSTR NE (DX1(I),4,2)IN ('03', '11', '13', '21', '23', '31', '33', '41', '43', '51', '53', '61', '63', '71', '73', '81', '83', '91', '93') THEN T2D = 0; /**the codes in the DX1(I),4,2 function are type I diabetes**/
OR SUBSTR (DIAG(I),1,3) IN ('E11')then T1D = 1;
LABEL T2D ='Type II Diabetes';
END;
RUN;
can't use the NE function with substr. Please advice.
Thank you