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

hi I have a table that shows 8 days worth of data which includes today's date  I need to exclude today's date ...

the he data looks like this

03/13/15.    Tid

03/14/15.     Tid

03/15/15.      Tid

03/16/15.      Tid

03/17/15.      Tid

03/18/15.       Tid

03/19/15.       Tid

3/20/15.         Tid

I Need to remove current date since its a partial data and keep first 7 days thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

if date = today() then delete;

View solution in original post

2 REPLIES 2
Ksharp
Super User

if date = today() then delete;

Patrick
Opal | Level 21

Please try and provide ready made sample data (so a data step creating the table) so we don't have to do this. It's also always good to post some code even if unfinished as this will help us to better understand where you're coming from.

data have;

  attrib

    have_date length=8 informat=mmddyy10. format=date9.

    other_var length=$8

    ;

  infile datalines dlm='.' truncover;

  input have_date other_var;

  datalines;

03/11/15. Tid

03/12/15. Tid

03/13/15. Tid

03/14/15. Tid

03/15/15. Tid

03/16/15. Tid

03/17/15. Tid

03/18/15. Tid

03/19/15. Tid

03/20/15. Tid

;

run;

data want;

  set have;

/*  if 1<= (today() - have_date) <=7;*/

  if 1<= ('20Mar2015'd - have_date) <=7;

run;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1117 views
  • 3 likes
  • 3 in conversation