I have the following:
data egtask.ovrfy_ind_curr_t1; set ibs.overfy&cfyear; where month(fltdate)<>&month_now and status_code="I"; MarketSubmarket = Market * 10 + SubMarket; Month = month(fltdate); run;
Now this works perfectly, except that I do not want the restriction:
where month(fltdate)<>&month_now
to be run in the month of September. So if the month the dataset is run is 9, then the where statement should be:
where status_code="I";
and all other months it should be:
where month(fltdate)<>&month_now and status_code="I";
I do have a global macro variable called month_now, but I am not sure it can be used. Is something like this possible..a conditional where?
Try this:
where (month(fltdate) ne &month_now or &month_now = 9) and status_code="I";
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.