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

I have a data set that I run every month with data from the 1st through the 30/31st, but I would like to delete observations that come after the 15th of that month. 

 

Can someone help me create an if statement that will delete any observations that come after the 15th of every month?

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

without sample, I am guessing

 

if day(date)>15 then delete;

View solution in original post

5 REPLIES 5
novinosrin
Tourmaline | Level 20

without sample, I am guessing

 

if day(date)>15 then delete;
aperansi
Quartz | Level 8
so the variable in question is called est_date, so would I replace the "date" you have in the parentheses with est_date?
novinosrin
Tourmaline | Level 20

yes that's correct

aperansi
Quartz | Level 8

thank you so much for your help!

novinosrin
Tourmaline | Level 20

You are welcome. Thank you for your questions and participation on the community

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1612 views
  • 1 like
  • 2 in conversation