Date: Wed, 27 Oct 2004 03:21:20 GMT
Reply-To: EconMan <*remove_this_anti-spam_device*econman711@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: EconMan <*remove_this_anti-spam_device*econman711@COMCAST.NET>
Organization: Comcast Online
Subject: Re: First day of month except if on weekend
Content-Type: text/plain; charset=us-ascii
Thank you. That helps me very much. I was making it much to
complicated.
Mark
On 26 Oct 04 06:20:57 GMT, Philip_Crane@WORKCOVER.VIC.GOV.AU wrote:
>Mark
>
>The following should do what you want.
>
> 3 data test;
> 4 do i = 1 to 24;
> 5 strt_dt = intnx("month",'01Oct2004'd, i, "b") ;
> 6 if weekday(strt_dt) = 1
> 7 then strt_dt = strt_dt - 2; /* Move a Sunday start */
> 8 if weekday(strt_dt) = 7
> 9 then strt_dt = strt_dt - 1; /* Move a Saturday start */
> 10 output;
> 11 end;
> 12 run;
> 13
> 14 proc print data=test;
> 15 format strt_dt weekdate17.;
> 16 run;
>
>Philip
>
>
>
> EconMan
> <*remove_this_anti-spam_device*econman711@C To: SAS-L@LISTSERV.UGA.EDU
> OMCAST.NET> cc:
> Sent by: "SAS(r) Discussion" Subject: First day of month except if on weekend
> <SAS-L@LISTSERV.UGA.EDU>
>
>
> 26/10/2004 02:53 PM
> Please respond to EconMan
>
>
>
>
>
>
>Hello,
>
>I'm wanting to compute (print) the following.
>
>The date of the "1st of the month" for the next two years except if
>the 1st falls on a weekend, then I want the Friday before....
>
>
>Anyone have an idea for this ?
>
>Thanks much.
>
>Mark
>
>
>
>
>
>************************************************************************
> IMPORTANT -
>
>(1) The contents of this email and its attachments may be confidential
> and privileged. Any unauthorised use of the contents is expressly
> prohibited. If you receive this email in error, please contact us,
> and then delete the email.
>
>(2) Before opening or using attachments, check them for viruses and
> defects. The contents of this email and its attachments may become
> scrambled, truncated or altered in transmission. Please notify us
> of any anomalies.
>
>(3) Our liability is limited to resupplying the email and attached files
> or the cost of having them resupplied.
>
>(4) We collect personal information to enable us to perform our
> functions. For more information about the use, access and
> disclosure of this information, refer to our privacy
> policy at our website.
>
>************************************************************************
|