Date: Fri, 13 Jan 2006 20:46:45 -0500
Reply-To: "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Subject: Re: trying to output last 8 rows of each month
Content-Type: text/plain; charset="iso8859-1"
Since only 8 obs are added each day, and you want to keep 8 rows from
the last day, no counter is necessary. All that remains is to check
that the obs we have is for the last day of the month.
data last8;
set incoming;
if date = intnx('month',date,0,'end');
run;
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of David Fickbohm
Sent: 2006, January, 13 8:06 PM
To: sas-l@listserv.uga.edu
Subject: trying to output last 8 rows of each month
People,
I have a file containing data from feb 2003 until the present.
Each day 8 rows are added to the file.
I want to output 8 rows from the last day of each month from feb 2003
until the present.
The data looks like this
date class level count
020603 1 8z 12
020603 1 16z 13
020603 1 9z 15
020603 1 10z 14
020603 2 8z 20
020603 2 12z 31
020603 2 14x 41
020603 2 15z 44
020703 1 8z 12
020703 1 16z 13
020703 1 9z 15
020703 1 10z 14
020703 2 8z 20
020703 2 12z 31
020703 2 14x 41
020703 2 15z 44
more days of data
022803 1 8z 12
022803 1 16z 13
022803 1 9z 15
022803 1 10z 14
022803 2 8z 20
022803 2 12z 31
022803 2 14x 41
022803 2 15z 44
I want the output to look like:
022803 1 16z 13
022803 1 9z 15
022803 1 10z 14
022803 2 8z 20
022803 2 12z 31
022803 2 14x 41
022803 2 15z 44
all ideas will be greatly appreciated.
Thanks
Dave
Dave Fickbohm
Use Technology to the Fullest
1250 45th st suite 200
Emeryville, CA, 94608
510 594 4151 voice
_______________________________________________________________________
This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.
Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite.
Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.