Probably an easy task for a pro but I got stuck with this trivial problem for quite some time now: I have this table as a start: data inTable; input ICD $ Drugs MDD ; datalines; F111 . . F60 . . F132 . . F323 . . F331 . . ; I want to get the following results table: data outtableDesired; input ICD $ Drugs MDD ; datalines; F111 1. F60 . . F132 1 . F323 . 1 F331 . 1 ; I tried the following: data outtable; set inTable; if ICD in ('F11%','F13%') then do; Drugs=1; end; if ICD in ('F32%','F33%') then do; MDD=1; end; run; Apparently '%' does not work in 'if ... then' procedures ... or? Any alternatives? Of course, my real table is much larger with many more options for ICD, that's why I have to write just the beginning of the character string and then '%'. Thanks in advance for your time to help me with a solution!
... View more