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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 873 views
  • 3 likes
  • 3 in conversation