Tuesday, July 7, 2015

SAS: Using "in" within a macro %if



This was new to me…want to use an “in” within a macro “%if”?  Then you need to use the sas option minoperator.  I found a use for it as follows:

options minoperator; * required for in within a macro if ;   
%if (&RUN_TIME_ROUNDED in &GLBL_EMAIL_DASHBOARD_RECON_WHEN) %then %do;

Where

%let GLBL_EMAIL_DASHBOARD_RECON_WHEN = (21600 43200 64800);

Note “in” values are space-delimited. Comma-delimited requires yet another macro option (not system option).  Details at http://support.sas.com/kb/35/591.html