LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 1999, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Joseph Earley <jearley@POPMAIL.LMU.EDU>
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


Back to: Top of message | Previous page | Main SAS-L page