Reputation: 77
I am creating this macro variable LOG_LIST and feeding it with a list of values and using it later for my logistic regression. The code is below.
proc sql;
select name into :LOG_LIST separated by ' '
from WORK.logcolumnslist;
quit;
proc logistic data=test_dataset;
model logistic_var= age sex &LOG_LIST.;
run;
There are few cases in which the dataset work.logcolumnslist would be empty, in which case I would like the LOG_LIST to take a value of null so that my logistic regression does not screw up. I tried %Let statements and even changing the value of the macro variable in sashelp.vmacro table but it did not work. Is there a way to reset the value to null?
Thanks!
Upvotes: 1
Views: 2992
Reputation: 63424
Before the PROC SQL
, assign a null value to it using %let
.
%let log_list=;
proc sql;
select name into :LOG_LIST separated by ' '
from WORK.logcolumnslist;
quit;
%put &=log_list.;
Upvotes: 2