You don't need macro statements in your data step, and you don't need to reread temf to set indicator. Replace this code --------------------------------------------------------- run; data temf; set temf; %if per_miss > 0.50 %then %do; indicator = trim(ind_name)||'=('||trim(_name_)||'=.)'; run; %end; %else %if 0.10 <per_miss <= 0.50 %then %do; indicator = trim(ind_name)||'='||trim(medianstr); run; %end; %else %do; indicator = 'none'; ---------------------------------------------------------- with this code ---------------------------------------------------------- select; when per_miss > 0.5 indicator = trim(ind_name)||'=('||trim(_name_)||'=.)'; when per_miss > 0.1 indicator = trim(ind_name)||'='||trim(medianstr); otherwise indicator = 'none'; end;
... View more