Along those same lines I was toying with the idea of calculating dates,
in MPEX, and came up with this one several years ago. You enter the
month and year and it returns the date of the first Monday for that
month. It was useful at a previous place of employment.
Parm fm_mm="!hpmonth", fm_yy="![rht('!hpyyyy',2)]"
option nolist
If not numeric('!fm_mm') then
# created by Larry A. Barnes
echo
echo This script will generate the date for the first
echo Monday in the specified Month and Year.
echo
echo The Syntax is:
echo
echo FIRSTMON [fm_mm], [fm_yy]
echo
echo fm_mm = the numeric value for the
month
echo you wish to check on.
echo Default is the current
month.
echo
echo fm_yy = the numeric value for the
year
echo you with to check on.
echo Default is the current year.
echo
return
Endif
setjcw insidempex = 0
if insidempex <> 0 then
setvar fm_dd "01"
setvar fm_mm rht('00'+'!fm_mm',2)
setvar fm_yy rht('00'+'!fm_yy',2)
setvar fm_date
strwrite(datebuild(!fm_yy,!fm_mm,!fm_dd):'%0M/%0D/%4Y')
setvar fm_yr rht('!fm_date',4)
SETVAR fm_MMM STRWRITE(!fm_date:'%1M')
IF DateDayOfWeek(!fm_date) = 1 then
Setvar FirstMon !fm_date + 1
ELSEIF DateDayOfWeek(!fm_date) = 2 THEN
SETVAR FirstMon !fm_date
ELSE
SETVAR FirstMon STRWRITE(!fm_date +
9-DateDayOfWeek(!fm_date):'%0Y/%0M/%0D')
ENDIF
setvar fm_2d rht('!firstmon',2)
ECHO
ECHO The First Monday of !fm_mmm !fm_yr is
!fm_mmm-!fm_2d
DELETEVAR fm_@,mpex@ >$NULL
else
run mpex.pub.vesoft;parm=1;info="!hpfile '!fm_mm',
'!fm_yy'"
endif
-----Original Message-----
From: Greg Stigers [mailto:[log in to unmask]]
Sent: Wednesday, September 08, 2004 7:19 PM
To: [log in to unmask]
Subject: [HP3000-L] Labor Day and other holidays
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.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|