Date: Thu, 9 Oct 2008 14:40:34 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: calculate last day to start vacation
On Thu, 9 Oct 2008 19:24:26 +0300, gbb
>suppose I know the number of vacation hours remaining for the year, ie. 16
>suppose I also know that since each 8 hour block equals 1 day, then 16 /
>2 days remaining
>some people are coded to work a weekday(2,3,4,5,6) Mo-Fr schedule, others
>may have Su, Sa
>how could I calculate the absolute start time for their annual vacation,
>using the above knowledge?
> input schedule hours; * schedule 1 = Mo-Fr, 2=Tu-Sa, 3=Sa,Su, Mo-We ;
>since the above person has schedule type 1, their absolute last day to
>vacation is 12/30/08 which is 2 days before the end of the year (Tu
>and We 12/31/08)
what about holydays? Are they counted as vacation days or not? Think not...
So you might need a format or something else to track that also.
The formula of Gauss might help you to get the easter and all the other
For each schedule mark the days which are not to be counted as vacation
days with the help of the holydays and the weekday function. So you might
get a format for each date which tells you that the day is to be counted
Eg the format $vac could be like:
"1+24dec2008" = "blocked"
"1+23dec2008" = "vac "
That format you can build. Then you know, how many vacation days are to be
taken for that year and you can count back.
date = "01jan2009"d;
do while (counter<vac_2_take);
if put(cats(put(sched,1.),"+",put(date,date9.),$vac.)=: "vac" then
don't know if that works, but something like that...