|
One sample value suggests the month names are truncated to three letters.
Another ("April") suggests that they are not. If they are not *all*
truncated, the solution becomes more intricate.
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?
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!
>>
|