1
votes

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!

1

1 Answers

2
votes

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.;