Hello all, I kindly ask for a help with one issue. While dealing with a macro loop in a data step i have a problem with app_number_of_children variable in prod_sorted table. Despite the condition 'not missing(app_number_of_children) and app_number_of_children<1', and expected result 1 in wyj.vin_kat, there is value 3 apearing all the time. As i can understand, the macro loop rewrite the value after each iteration. How can I avoid it and get the right value? Regards, SH %global test;
proc sql noprint;
select warunek into :test separated by ' X'
from wyj.warunek order by warunek;
quit;
proc sql noprint;
select count(*) into :ile_war
from wyj.warunek;
quit; %macro kategoryzuj;
data wyj.vin_kat;
set wyj.prod_sorted;
%do a=1 %to &ile_war;
%let war = %scan(%scan(&test,&a,'X'),3,'A');
%let zmien = %scan(%scan(&test,&a,'X'),1,'A');
%let wart = %scan(%scan(&test,&a,'X'),2,'A');
if &war then &zmien = &wart;
%end;
output;
end;
run;
%mend;
%kategoryzuj;
... View more