I'm very new to Macro. I have 5 variables A,B,C,D,E. also I have a code need to repeat, this code used for filling up previous missing value. data want;
do until(not missing(status) or last.id );
set have;
by id;
end;
temp=status;
do until(not missing(status) or last.id );
set have;
by id;
_status=temp;output;
end;
drop temp status;
run; I need input variable A into this code, then generate table A, then use tableA as base table, then input variableB into tableA, and so on, until I input last variable E. So final table E will come out, which contains all 5 variables with filling values. My logic to get what I want: data tableA; set old; (fill up variableA); run; data tableB; set tableA; (same fill up code to fill up tableB); run; ..... data tableE;----------FINAL table filling up all missing values for 5 variables. set tableD; (same fill up code tp input variableE); run; sample data have: id varA B C D E 1 . . . . . 1 n m l p k want: id varA B C D E 1 n m l p k 1 n m l p k I know how to fill up one by one. I'm thinking if I can use macro to get this final table? or other ways to do that? Thank you for your help! Appreciate!
... View more