Previous Topic: 4.7.2.3 Calendar Modifications for 445/454/544 Calendars

Next Topic: 4.8 Account Code Determination Routine Coding

4.7.2.4 Whether to Use DWMY12 or DWMYWK1 Date Macros


The effect of choosing either the #DWMY12/$DWMY12 set of
macros or the #DWMYWK1/$DWMYWK1 set of macros is explained
below.  This discussion may be of particular interest to
non-North American CA MICS installations.

Note: When we talk about the "second week of a year," the
meaning is different from the parameter WEEK=01, as
designated in CA MICS.

Note that the WEEKSTART parameter in MICS.PARMS(SITE) is
assumed to be equal to one.  (For more information on the
WEEKSTART option, see Section 2.3.1.8 in the PIOM.)

When DWMY12 Is Used
-------------------

This set of date macros is the default.  It provides
specifications that correspond most closely to the definition
of days/weeks/months normally used and understood in North
America.

The determination of the calendar week of the year element
(WEEK) is an integer from 1 to 54:

o WEEK=01 begins on the first day of the calendar year and
  extends up to the end of the following Saturday.

o WEEK=53 begins on the last Sunday of the calendar year and
  extends up to the end of that year.

See sharedprefix.MICS.DIC.TEXT(WEEK) for more details.

When a MICF query requests observations from the previous
week, the date macros determine the WEEK value that
corresponds to the seventh day prior to the query run date.
Then the query selects all observations with matching WEEK
values.  Consequently, when the query is run during the
second week of a year (WEEK=02), query results will appear to
be either inaccurate or inconsistent from day to day.

For example, consider a query run in the second week of 2004.
If the query is run on January 4th, 5th, 6th, or 7th,
observations from December 28th through December 31st are
selected.  If the query is run on January 8th, 9th, or 10th,
observations from January 1st through January 3rd are
selected.  So depending on the run date, query results will
differ.

When DWMYWK1 Is Used
--------------------

This set of date macros corresponds most closely to the
definition of days/weeks/months that supports various
international preferences.

If you choose this set of date macros, WEEK=01 begins on the
Sunday of the second week of the year, if the first week has
three days or less (for example, the first week in 2004).
Furthermore, there are no partial weeks at year-end or
year-beginning.  For example, WEEK=53 can contain
observations from December 28 right through to and including
January 3.

When a query requests observations from the previous week,
the date macros determine the WEEK value that actually
corresponds to the week prior to the query run date.
However, the current behavior of MICF is such that the query
selects only observations with matching WEEK values plus a
YEAR value corresponding to the previous year.

Consequently, when the query is run during the second week of
a year (WEEK=01 or WEEK=02), observations from the first few
days in January are not selected.  This occurs because the
YEAR value used by the MICF TMFRSEL macro to select
observations corresponds to the previous year.  This causes
the query results to appear to be either inaccurate or
insufficient.