Greg,
You could do the following:
1. Create a file containing the holiday dates for your site (i.e.
/SYS/PUB/HOLIDAY)
The dates should be in "yyyymmdd" format and can also contain a
textual description of the holiday.
2. Create the following command file:
setvar _today
![RHT(hpdatef,4)+RHT("0!hpmonth",2)+RHT("0!hpdate",2)]
GREP.HPBIN.SYS "!_TODAY /SYS/PUB/HOLIDAY"
setvar HOLIDAY CJCW = 0
3. Upon executing the command your 'holiday' CI variable will be set
correctly and the qualifying date will be displayed on the $stdlist.
Then its just a matter of keeping the 'holiday' file current. Which would
be easier than keeping the code, below, current.
Regards
Paul Christidis
HP-3000 Systems Discussion <[log in to unmask]> wrote on 09/08/2004
07:18:48 PM:
> We do not have any third-party scheduling tools. I may post about that
concern
> later. But for those who are not relying on third-party scheduling
> tools, I was
> wondering how you handled Labor Day and other holidays.
>
> I am thinking of using a command file to test the various months,
> days, and days
> of weeks. Of course, holidays are of two types: fixed date (New Years
Day,
> Fourth of July, Christmas) and day of week (Memorial Day, Labor Day,
> Thanksgiving and the day after Thanksgiving, and in some companies,
Friday
> before or Monday after a weekend holiday, like this year's New Year's
Eve).
> Each have their wrinkles. Here is what I have come up with, for our
listed
> holidays. Comments and suggestions on this command file are welcome.
>
> #In January, test for New Year's Day and the day after on a Monday
> IF !HPMONTH = 1
> IF !HPDATE = 1
> SETVAR HOLIDAY TRUE
> #Test for Monday after New Year's Day when New Year's Day falls on
Sunday
> ELSEIF !HPDATE = 2 AND !HPDAY = 2
> SETVAR HOLIDAY TRUE
> ENDIF
> #Test for Memorial Day
> ELSEIF !HPMONTH = 5 AND !HPDAY = 2 AND !HPDATE >= 25
> SETVAR HOLIDAY TRUE
> #Test for Fourth of July or Friday the 3rd or Saturday the 5th
> ELSEIF !HPMONTH = 7
> IF !HPDAY = 4
> SETVAR HOLIDAY TRUE
> #Test for Friday the 3rd of July when the Fourth is a Saturday
> ELSEIF !HPDAY = 6 AND !HPDATE = 3
> SETVAR HOLIDAY TRUE
> #Test for Monday the fifth of July when the Fourth of July is Sunday
> ELSEIF AND !HPDAY = 2 AND !HPDATE = 5
> SETVAR HOLIDAY TRUE
> ENDIF
> #Test for Labor Day, in September, Monday, of the first week
> ELSEIF !HPMONTH = 9 AND !HPDAY = 2 AND !HPDATE <= 7
> SETVAR HOLIDAY TRUE
> #Test for Thanksgiving, November, Thursday, fourth week
> ELSEIF !HPMONTH = 11 AND !HPDAY = 5 AND !HPDATE >=21 AND !HPDATE <= 27
> SETVAR HOLIDAY TRUE
> #In December: Christmas Eve, Christmas, Monday 26th & Saturday New
Year's Eve
> ELSEIF !HPMONTH = 12
> #Test for Christmas Eve on a Friday when Christmas is a Saturday
> IF !HPDATE = 24 AND !HPDAY = 6
> SETVAR HOLIDAY TRUE
> #Test for the Monday after Christmas when Christmas is on a Sunday
> ELSEIF !HPDATE = 26 AND !HPDAY = 2
> SETVAR HOLIDAY TRUE
> #Test for New Year's Eve Friday when New Year's Day falls on Saturday
> ELSEIF !HPDATE = 31 AND !HPDAY = 6
> SETVAR HOLIDAY TRUE
> ENDIF
> ELSE
> #None of these conditions are true
> SETVAR HOLIDAY FALSE
> ENDIF
> #Show the result
> SHOWVAR HOLIDAY
>
> We do not get the Friday after Thanksgiving. But that is an
> interesting problem
> for those who do. When November starts on a Friday, that is the
> fifth Friday of
> November, not the fourth Friday. I worked with a job scheduler that did
not
> handle that fine distinction. I believe the test for that would be
> #Test for the Friday after Thanksgiving; note when Nov 1 is a Friday
> ELSEIF !HPMONTH = 11 AND !HPDAY = 6 AND !HPDATE >=22 AND !HPDATE <= 28
> SETVAR HOLIDAY TRUE
>
> Greg Stigers
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|