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
if date = today() then delete;
if date = today() then delete;
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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: