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 (January 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 17 Jan 2006 08:38:52 -0800
Reply-To:     "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject:      Re: Working days in months
Comments: To: Amit Das <ADas@INDUCTIS.COM>
Content-Type: text/plain; charset="us-ascii"

Hi,

Here are a couple methods:

data _null_; AnyDateInDesiredMonth = today();

bom = intnx('month',AnyDateInDesiredMonth,0,'b'); eom = intnx('month',AnyDateInDesiredMonth,0,'e');

WeekDaysInMonth = intck('weekday',bom,eom);

format AnyDateInDesiredMonth bom eom mmddyy10.; put _all_; run;

data _null_; AnyDateInDesiredMonth = today();

WeekDaysInMonth = intck('weekday', intnx('month',AnyDateInDesiredMonth,0,'b'), intnx('month',AnyDateInDesiredMonth,0,'e'));

format AnyDateInDesiredMonth mmddyy10.; put _all_; run;

data _null_; AnyDateInDesiredMonth = today();

bom = intnx('month',AnyDateInDesiredMonth,0,'b'); eom = intnx('month',AnyDateInDesiredMonth,0,'e');

weekdays = 0; do i = bom to eom; if put(i,weekday.) not in('1','7') then weekdays = weekdays + 1; end; put weekdays=; run;

data _null_; AnyDateInDesiredMonth = today();

bom = intnx('month',AnyDateInDesiredMonth,0,'b'); eom = intnx('month',AnyDateInDesiredMonth,0,'e');

weekdays = 0; do i = bom to eom; if weekday(i) not in(1,7) then weekdays = weekdays + 1; end; put weekdays=; 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 Amit Das Sent: Tuesday, January 17, 2006 7:47 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Working days in months

if you install the excel add-ins, the you can use the function NETWORKINGDAY to count the number of working days between two dates!

________________________________

From: SAS(r) Discussion on behalf of Elmaache, Hamani Sent: Tue 1/17/2006 7:29 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Working days in months

Hi there. I would calculate number of working days in some months, let's say:

working days in: 2006 june october 2007,....

I was told that I had to use weekday(today()); but how? Thanks for any help.


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