Date: Tue, 9 Jan 2007 15:44:12 -0800
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: Looping Over Dates
Content-Type: text/plain; charset="us-ascii"
Hi Ken,
One of several approachs: this one takes
advantage of the DO loop incrementing by 1
and merely pushing the date to the end of
the month right before the DO loop increments.
data _null_;
format firstofmonth date9.;
do firstofmonth = '1DEC2005'd to '1FEB2007'd;
put firstofmonth=;
* your stuff here ;
firstofmonth = intnx('month',firstofmonth,0,'e');
end;
run;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Barz, Ken
Sent: Tuesday, January 09, 2007 3:27 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Looping Over Dates
I would like to be able to loop over a series of dates, but have the
loop only look at a particular day of the month. (e.g. 1DEC2006,
1JAN2007, 1FEB2007,...)
Is there some relatively uncomplicated way to do this?
Thanks
Ken Barz
Software Engineer
Intrado Metrics
Intrado Inc.
1601 Dry Creek Drive
Longmont, CO 80503
direct: 720.494.5868
pager: 303-581-7667
fax: 720.494.6600
email: ken.barz@intrado.com
Intrado.(r)
www.intrado.com
<file:///C:\Documents%20and%20Settings\kbarz\Application%20Data\Microsof
t\Signatures\www.intrado.com>
ATTENTION:
The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify Intrado Inc. immediately at
720.494.5800 and destroy all copies of this message and any attachments.