HP3000-L Archives

March 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Steve BARRETT <[log in to unmask]>
Reply To:
Steve BARRETT <[log in to unmask]>
Date:
Sat, 21 Mar 1998 14:47:00 +0000
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (75 lines)
Neil Harvey wrote:

The create date on the file is 09 Jul 1996, which was a Tuesday :).
It accepts years without centuries, but assumes 19 if this is so.

Maybe someone with energy can check it out for accuracy.
Maybe someone can own up as the author, and take credit ;)

<SNIP>

-------------------------Reply Separator-----------------

I posted a day-of-the-week command file some time ago.  However, even
though the algorithim is similar, the coding technique and design is
disimilar enough to indicate that it probably wasn't based on my
post.

This a re-post of the command file - it was written for demonstration
purposes, but could be easily hacked and used for practical purposes:

  parm d="01/01/2000"
  setvar cal_day "!d"
  setvar mo str(cal_day,1,2)
  setvar day str(cal_day,4,2)
  setvar year str(cal_day,7,(len(cal_day) - 6))
  setvar wkday "SUNMONTUEWEDTHUFRISAT"
  setvar wdleapy "034025036146"
  setvar wdleapn "144025036146"
  setvar century !year/100*100
  setvar yr !year-!century
  setvar wday wdleapn
  if (((!year mod 4) = 0) and ((!year mod 100) <> 0)) or ((!year mod 400) = 0)
       setvar wday wdleapy
  endif
  setvar dv str(wday,!mo,1)
  setvar dayval (!yr/4)+!yr+!dv+!day
  if (!century mod 400) = 0
       setvar dayval (!dayval - 1)
  endif
  setvar dayval (!dayval mod 7)
  if !dayval = 0
       setvar dayval 7
  endif
  setvar daywk str(wkday,(!dayval*3-2),3)
  echo The day of the week for !cal_day is !daywk.

We use a couple of CI date calculation programs for job scheduling
that - among other things - contain this day-of-the-week algorithym.
One of these calculates a date based on an integer offset between 0
and + or - 365 (zero being the current date. The other program
similarly calculates the first and last date of a month that is
derived from an offset of the current month.

We use a combination of these programs and the "editor" in batch mode
to perpetuate the automatic scheduling of periodic jobs. That is -
the last thing the batch job does is edit its own job stream with new
report dates (if required) and then re-stream itself using the dates
derived from the CI program(s).

If anyone is interested in obtaining these command files, please
e-mail me privately.

Steve Barrett

   ============================================================
   = Steven P. Barrett    [log in to unmask] =
   = Systems Analyst                                          =
   = Fairfax County Public Library     (703) 222-3132 - Voice =
   = Technical Operations Center       (703) 222-3135 - FAX   =
   = 4000 Stringfellow Rd.                                    =
   = Chantilly, VA  20151                                     =
   =                                                          =
   = --- The opinions expressed here are mine alone . ---     =
   ============================================================

ATOM RSS1 RSS2