sas macro - Check if a SAS DIS parameter is null -
in sas dis have set date parameters on job. tried setting default values using drop down menu provided, each time error
syntax error, expecting 1 of following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, and, eq, ge, gt, in, le, lt, max, min, ne, ng, nl, notin, or, ^=, |, ||, ~=.
i therefore decided try check if parameter null before proceeding, none of various attempts succeeded. there way user-written code?
if(&date_param = .) do; date = today(); else do; date = &date_param; end;
i tried within macro , did not work.
much gratitude.
assuming similar standard sas macro variable, couple of things.
first off, null parameter literally blank, not period (that's numeric dataset variables). in data step check so:
if "&date_param." = " " do;
second, depending on context may need in macro syntax. if you're setting parameter, may need do:
%if &date_param. eq %then %do; %let date=%sysfunc(today()); %end; %else %do; %let date = &date_param.; %end;
%sysfunc
lets execute data step function in macro code.
Comments
Post a Comment