Date: Mon, 30 Aug 1999 13:56:25 -0700
Reply-To: "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Subject: Re: Subsetting observations by date
Content-Type: text/plain
Hi Joseph,
Try the same, but remove the datepart() function.
HTH,
Mark Terjeson
Washington State Department of Social and Health Services
Division of Research and Data Analysis (RDA)
(360) 902-0741
(360) 902-0705 fax
mailto:terjemw@dshs.wa.gov
> -----Original Message-----
> From: Joseph Earley [SMTP:jearley@POPMAIL.LMU.EDU]
> Sent: Monday, August 30, 1999 1:37 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Subsetting observations by date
>
> Hello SAS-L-
>
> I would like to create 12 data sets according to month. For example,
> data set jan would have the values for jan82, jan83, jan84, etc. Data set
> feb would be feb82, feb83, etc.
>
> The original time series is monthly and the date variable was created
> using:
>
> date = intnx('month','31dec1981'd,_n_);
>
>
> The following code doesn't seem to work.
>
> data jan feb march .....................dec ;
>
> set original_series;
>
> if month(datepart(date)) = 1 then output jan;
>
> else if month(datepart(date)) = 2 then output feb;
>
> .......
>
> else if month(datepart(date)) = 12 then output dec;
> run;
>
>
> Would anyone kindly identify the problem or a more efficient way to do
> this.
>
> Also, any references on working with date problems like this (other than
> Karp: working with SAS data and time functions)
>
> tia,
>
> joe
|