Date: Wed, 10 Jul 2002 11:04:27 -0700
Reply-To: Pete Lund <pete.lund@NWCSR.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Pete Lund <pete.lund@NWCSR.COM>
Subject: Re: Automatic Axis Statement
In-Reply-To: <OF955C1FD7.FE150C17-ON41256BF2.0067211C@db.com>
Content-Type: text/plain; charset="iso-8859-1"
I would add one thing to Peter's solution. Since &SYSDATE returns the date
when the SAS session was started it is not always the current date. You
could simply substitute the TODAY() function, in its own SYSFUNC, for
&SYSDATE.
Something like:
%sysfunc( intnx( week, %sysfunc(today()) , -1, ending ) )
----------------------------------------------------------------------------
---
Pete Lund
Northwest Crime and Social Research, Inc.
A SAS Alliance Partner
215 Legion Way SW
Olympia, WA 98501
(360) 528-8970 - voice
(360) 280-4892 - cell
(360) 570-7533 - fax
pete.lund@nwcsr.com
www.nwcsr.com
----------------------------------------------------------------------------
---
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Peter Crawford
Sent: Wednesday, July 10, 2002 11:55 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Automatic Axis Statement
The derivation
(today()-weekday(today()))
looks like you want the last day of last week
It can be done in the %sysfunc environment, like
%sysfunc( intnx( week, "&sysdate"d, -1, ending ) )
It will deliver a number of days since 1960,
but that seems to be what you need if '06oct01'd
is appropriate
Good Luck
Peter Crawford
-----Original Message-----
From: E. S. [mailto:sasq98@YAHOO.COM]
Sent: Wednesday, July 10, 2002 7:48 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Automatic Axis Statement
Hi all,
I have a problem that seemed trivial when I looked at it first but that
now is giving me all kinds of headaches.
I have an axis statement that looks like this:
axis1 order = ('06oct01'd to '29jun02'd by 7);
It works fine but now I want to be able to change the endpoints by
using a formula. Something like:
axis1 order = ('06oct01'd to (today()-weekday(today())) by 7);
I get an error when I try that, can anybody tell me how could I code it
soo that I don't have to be manually updating this axis statement every
week?
Thanks a lot,
Ed
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.