Week of year?

Chris Sharman Chris.Sharman@ccagroup.co.uk
Tue, 7 Mar 2000 11:35:26 +0000


>There's an ISO standard that covers week numbering, and in a very old
>SupportLink I'm sure there's an article on how to calculate it. I'll try
>searching my archives, but someone else might know where it is. The User
>Group book might be another source - I think it has a section on dates that
>covers just about everything...

Here (and probably other places) monthend and yearend is when the finance
director says it is: "We need more turnover this month, so we'll have an extra
week".

We implement this through a calendar file, which we populate with a Quick
screen which defaults to a 4-4-5 pattern, but allows pretty much anything.
And yes, they really did decide that, about 3 weeks before what would have been
year-end: the last month was extended to six weeks. Maybe the IRS imposes more
rigidity in the US, but here, you're effectively free to decide your own fiscal
year.

I've included our weekly calendar file below: it allows lookup by date, by
year+week, year+month, or year+month+week, although if I designed it now, it
would definitely use zoned numbers, rather than integers: it predates our use
of Powerhouse.

Chris

    Record:             WEEKLY-CALENDAR
    of File:            WEEKLY-CALENDAR
    Organization:       INDEXED
    Type:               RMS
    Open:               COE_FILES:WEEKLY-CALENDAR.DAT
    Record Format:      Fixed
    Supersede:          No

    Record Size:        12 Bytes

-- Record Contents --
    Item                                 Type            Size  Occ  Offset
    YEAR-PERIOD-WEEK                     CHARACTER          4            0
    .CAL-YEAR                            INTEGER UNSIGNED   2            0
    _CHAR-YEAR                           CHARACTER          2            0
    .CAL-PERIOD                          INTEGER UNSIGNED   1            2
    .CAL-WEEK                            INTEGER UNSIGNED   1            3
    _CHAR-WEEK                           CHARACTER          1            3
   _YEAR-PERIOD                          CHARACTER          3            0
    WEEK-START-DATE                      VMSDATE            8            4

-- Index Contents --

 ** WEEK-START-DATE is a 8 byte   UNIQUE ALTERNATE ASCENDING  index **

    Segment                              Type            Size
    WEEK-START-DATE                      VMSDATE            8

 ** YEAR-PERIOD-WEEK is a 4 byte   UNIQUE PRIMARY ASCENDING  index **

    Segment                              Type            Size
    YEAR-PERIOD-WEEK                     CHARACTER          4

 ** YEAR-WEEK is a 3 byte   UNIQUE ALTERNATE ASCENDING  index **

    Segment                              Type            Size
    CHAR-YEAR                            CHARACTER          2
    CHAR-WEEK                            CHARACTER          1

 ** YEAR-PERIOD is a 3 byte   REPEATING ALTERNATE ASCENDING  index **

    Segment                              Type            Size
    YEAR-PERIOD                          CHARACTER          3

_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk		http://www.ccastat.demon.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.