BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cho16
Obsidian | Level 7

Hi ,

 

I have a report that will run on first of the every month.I want to exclude the future month effective date from the report. April month report should not include members with effective date  April, May, etc.

 

 

Membno Effdat    Expdat

1        20140301  20141231
2        20170401  20170430
3        20170105  20170130
4        20170301  20170330
5        20170501  20170528

 

I have the format as YYMMDDN8. for the Effdat and EXPDAT field.

 

Output should be as below:

 

Membno Effdat    Expdat

1        20140301  20141231
3        20170105  20170130
4        20170301  20170330

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Or a different where statement:

 

where effdat le intnx('month',today(),-1,'e');

or

where effdat lt intnx('month',today(),0,'b');

 

which would exclude recods with an effdate greater than or equal to the beginning of the current month

View solution in original post

2 REPLIES 2
Reeza
Super User

Add a filter to your query.

 

WHERE date < {date of interest};

ballardw
Super User

Or a different where statement:

 

where effdat le intnx('month',today(),-1,'e');

or

where effdat lt intnx('month',today(),0,'b');

 

which would exclude recods with an effdate greater than or equal to the beginning of the current month

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 823 views
  • 0 likes
  • 3 in conversation