BookmarkSubscribeRSS Feed
BCNAV
Quartz | Level 8

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?

 

 

1 REPLY 1

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 411 views
  • 0 likes
  • 2 in conversation