could you please try the below code and let me know if it helped you. sorry i could not test it %macro test; PROC SQL; CREATE TABLE WORK.QUERY_FOR__Study_Data AS SELECT t1.CISBR_ID, t1.'Local ID'n, (CASE %do i = 1 %to 66; %let j=put(&i,z2.); WHEN t1.'Local ID'n like "&i.%" then "2-0&j." %end; else "." end) Format $Char8. as Subject_ID, t1.'Conc1 pg/mL'n, t1.'Conc2 pg/mL'n, t1.'Mean pg/mL'n, t1.'Laboratory Code'n, t1.'CISBR Comments to Investigator'n FROM WORK.Study_Data t1; QUIT; %mend; %test; Thanks, Jag
... View more