@Son_Of_Krypton wrote:
NOTE: 0 observations were read from "WORK.Test3"
NOTE: Data set "WORK.testing" has 0 observation(s) and 3 variable(s)
920 %put value=&val.;
value=1
921 quit; run;
922 ODS _ALL_ CLOSE;
I still get value resolved to 1 it should resolve to 2 as dataset is empty
As Kurt wrote, your CALL SYMPUTX statement is never executing. If there are 0 obs in work.test3, when the below code runs:
data testing;
put "You will see me in the log because I execute before the SET statement";
set Test3;
put "You will not see me in the log because I never execute";
put (TOTAL_PAYMENTS_TO_DATE_LATEST TOTAL_PAYMENTS_TO_DATE_PREVIOUS)(=);
if TOTAL_PAYMENTS_TO_DATE_LATEST in (0,.) and TOTAL_PAYMENTS_TO_DATE_PREVIOUS notin (0,.) then call symputx("val",1);
else call symputx("val",2);
run;
the step stops executing immediately when the SET statement executes and hits the (logical) end-of-file mark in the dataset. So nothing after the SET statement will execute. If you delete the macro var VAL before this step, you will see that after the step, the macro var VAL will not exist. This is one of the challenges of working with global macro vars: they hang around in your session, and can cause confusion (for the programmer, not SAS 🙂
... View more