Date: Tue, 1 Jul 2008 13:40:17 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: Re: Selecting Observations by Date.
Karen,
Since you apparently want only yesterday the code should be
if date()-1 = dt ;
where DT is the date variable. For example.
213 data w ;
214 do dt = "1jun2008"d to "1jul2008"d ;
215 output ;
216 end ;
217 run ;
NOTE: The data set WORK.W has 31 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds
218
219 data yesterday ;
220 set w ;
221 if date()-1 = dt ;
222 put dt date9. ;
223 run ;
30JUN2008
Ian Whitlock
=================
Date: Tue, 1 Jul 2008 08:41:45 -0400
Reply-To: Karen smith <ponwtr@HOTMAIL.COM>
Sender: "SAS(r) Discussion"
From: Karen smith <ponwtr@HOTMAIL.COM>
Subject: Selecting Observations by Date.
Hello, All.
I run a job everyday, and I only want obs. from the previous day. I do not want to have to change the day every day, so I tried this:
CODE:
Today = Date();
Yesterday = Today - 1;
If Yesterday lt Today;
put @30 today @40 yesterday ; 17714 17713
Why didn't the above code select obs for June 30th.? There are obs. for that day.
Thanks In Advance