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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1155 views
  • 1 like
  • 2 in conversation