Date: Tue, 13 Jul 2004 23:54:27 -0400
Reply-To: sashole@bellsouth.net
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Paul M. Dorfman" <sashole@BELLSOUTH.NET>
Organization: Sashole of Florida
Subject: Re: a simple sas question!
In-Reply-To: <200407140029.i6E0Tfh20678@listserv.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of Howard Schreier
> Sent: Tuesday, July 13, 2004 8:30 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: a simple sas question!
>
> One sample value suggests the month names are truncated to
> three letters. Another ("April") suggests that they are not.
Howard,
Hereby lies the danger of induction: There is the 25% irregularity, and I
failed to notice.
> If they are not *all* truncated, the solution becomes more intricate.
Dare to differ. To become more intricate, it should be intricate to begin
with, and even if the month names had different lengths, I would have a hard
time qualifying the final solution as intricate. Less simple, maybe.
> Aside: If somebody poses a question and characterizes it as
> "simple", but that person does not know the answer, is that
> person really able to distinguish the simple from the not
> quite simple?
Perhaps the subtext here was "I suspect that for those who know how to solve
the problem, it is likely to be simple".
Kind regards,
----------------
Paul M. Dorfman
Jacksonville, FL
----------------
> On Tue, 13 Jul 2004 15:18:56 -0400, Paul M. Dorfman
> <sashole@BELLSOUTH.NET>
> wrote:
>
> >Assuming your dates are really stored in a character variable, say
> >CDATE, containing values as you show,
> >
> >Data subset ;
> > set being_subset ;
> > if '15apr2004'd <= input (compress (cdate), date9.) <=
> '15jun2004'd
> >; Run ;
> >
> >You can also use WHERE clause instead. There can be a myriad
> variants
> >on this theme depending on circumstances. Note that it is not a good
> >idea to store dates like this. You can see why from the fact that if
> >they were stored as SAS date values, the subsetting line
> would reduce
> >to
> >
> > if '15apr2004'd <= cdate <= '15jun2004'd ;
> >
> >Kind regards,
> >----------------
> >Paul M. Dorfman
> >Jacksonville, FL
> >----------------
> >
> >> -----Original Message-----
> >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of
> >> shimy apoorva
> >> Sent: Tuesday, July 13, 2004 2:56 PM
> >> To: SAS-L@LISTSERV.UGA.EDU
> >> Subject: a simple sas question!
> >>
> >> Hi All,
> >>
> >> I have this dataset with 17,648 observations. I want to create a
> >> sub-dataset which have observations from last 2 months. The date
> >> variable has dates in the form - 15 Feb 2004, 15 Mar 2004,
> 15 April
> >> 2004, 15 May 2004, 15 jun 2004.
> >>
> >> I want to create a sub-dataset which has observations only from 15
> >> April to 15 Jun.
> >>
> >> Can someone give me a syntax for this.
> >>
> >> Thanks in advance!
> >>
> >>
> >>
> >> ---------------------------------
> >> Do you Yahoo!?
> >> Yahoo! Mail - 50x more storage than other providers!
> >>
>
|