4. CA MICS Facilities › 4.7 Calendar Derivations › 4.7.2 Non-Standard Calendar Modifications › 4.7.2.1 Twelve Month Calendar Modifications
4.7.2.1 Twelve Month Calendar Modifications
Two varieties of Gregorian-based 12-month calendars exist:
o The fiscal year starts January 1.
o The fiscal year starts on the first of some other month.
Note: CA MICS Accounting and Chargeback lets you define a
unique accounting calendar, separate from the global CA MICS
calendar definitions. You can use it to meet your
requirements for chargeback and accounting relative to your
company's fiscal calendar, while continuing to use the
standard 12-month calendar for the majority of your CA MICS
information. See the Accounting and Chargeback Guide for
more information before altering the global CA MICS calendar.
If your CA MICS data center has a fiscal year that begins
January 1st of each year and ends 12 months later in
December, you do not need to make any changes to your
environment. (But you should review member MNTHFMT of the
sharedprefix.MICS.SOURCE library to ensure that it has not
been changed from the default that month 1 is called
JANUARY.)
Furthermore, there are some considerations surrounding the
calculation of the week of the year element (WEEK) when the
end of a year is reached. This arises because the week
boundary and the year boundary rarely coincide, leaving part
of a week in one year and the rest of the week in the next.
Thus, at the beginning of a new year, when reporting on the
previous week's observations, the result can appear to be
either inaccurate or inconsistent depending on the run date
of the report. See the discussion in Section 4.7.2.4.
On the other hand, if your data center uses the second
variety, where the year begins on the first day of some month
other than January, you should ensure that member MNTHFMT of
the sharedprefix.MICS.SOURCE library has been modified to
reflect your calendar. For example, if your fiscal year
begins on July 1st of each year, the statements in MNTHFMT
should be changed so that month 1 is JULY, month 2 is
AUGUST, and so forth.
If you need to make modifications, these changes will take
place when you next run BASPGEN or ALLPGEN. One result of
the running of the BASPGEN or ALLPGEN is the creation of a
format, MNTHFMT.
See the PIOM, Section 2.3.2.4, for the discussion under
Thirteen Month Fiscal Year Option. While this discussion
centers around 13-month calendars, the change to MNTHFMT is
indeed necessary for 12-month Gregorian-based fiscal year
calendars that begin on the first day of any month other
than January.
In addition to changing the MNTHFMT member of the
sharedprefix.MICS.SOURCE library, members #DWMY12 and $DWMY12
must be modified to reflect the start date of the fiscal
year. There are two alternatives for implementing the
modifications required to change the start date of your 12
month calendar.
ALTERNATIVE I : For implementing new date routines one unit
at a time.
A. CODE THE COMPLEX-LEVEL CPLXDEF OR UNIT-LEVEL SITE
PARAMETER MEMBER
If you want to define a global, complex-level special
calendar, then code the 13MONTHYEAR parameter in
sharedprefix.MICS.PARMS(CPLXDEF) as described below and
run sharedprefix.MICS.CNTL(CPLXGEN). The new
complex-level special calendar will take effect when
you execute the unit-level BASPGEN job.
Otherwise, specify the 13MONTHYEAR parameter in
prefix.MICS.PARMS(SITE) to restrict the special
calendar to a specific unit.
Code the parameter as follows:
'13MONTHYEAR NO #DWMY=#memname'
where memname is your modified member. (See the PIOM,
Sections 2.3.1.8 and 2.3.2.4 and Section 4.7.2.4 in
this guide.) Memname must exist as a #memname
version and as a $memname version if memname begins
with the letters DWMY. BASPGEN is coded to include
#DWMYxxx from the #BASMSTR module it generates and to
include $DWMYxxx from the $BASMSTR module it generates.
If memname does not begin with DWMY, BASPGEN will
generate code to include #memname from the #BASMSTR
module and from the $BASMSTR module.
For example, memname might be called DWMYSPC. Therefore
a # version would exist called #DWMYSPC, which contains
macro definitions written in SAS Macro statements. A
$ version, $DWMYSPC, containing corresponding macros
written in SAS Macro language would also exist. (You
will see below how to code changes for both members).
B. CODE THE CHANGES FOR #memname AND $memname
1. For the #memname (which contains the date macros
written with SAS Macro statements), consider the
following example: suppose that your site has a
fiscal year that begins on May 1 and May is
considered the first month in the year. The
#memname member would contain SAS code constructed
along these lines:
%INCLUDE SOURCE(#DWMY12);
MACRO _SETYRST
ENDDT = DATEPART(ENDTS);
TEMPMNTH = MONTH(ENDDT);
IF TEMPMNTH > 4 THEN
YRSTART = MDY(05,01,YEAR(ENDDT));
ELSE YRSTART = MDY(05,01,(YEAR(ENDDT)-1));
%
MACRO _YEAR
_SETYRST
YEAR = YEAR(YRSTART) - 1899;
%
MACRO _MONTH
TEMPMNTH = MONTH(DATEPART(ENDTS));
IF TEMPMNTH > 4 THEN MONTH = TEMPMNTH - 4;
ELSE MONTH = TEMPMNTH + 8;
%
2. For the $memname (which contains the date macros
written in SAS Macro language), for the same
situation as above, the code would take the form:
%INCLUDE SOURCE($DWMY12);
%MACRO SETYRST;
ENDDT = DATEPART(ENDTS);
TEMPMNTH = MONTH(ENDDT);
IF TEMPMNTH > 4 THEN
YRSTART = MDY(05,01,YEAR(ENDDT));
ELSE YRSTART = MDY(05,01,(YEAR(ENDDT)-1));
%MEND SETYRST;
%MACRO YEAR;
%SETYRST;
YEAR=YEAR(YRSTART) - 1899;
%MEND YEAR;
%MACRO MONTH;
TEMPMNTH = MONTH(DATEPART(ENDTS));
IF TEMPMNTH > 4 THEN MONTH = TEMPMNTH - 4;
ELSE MONTH = TEMPMNTH +8;
%MEND MONTH;
C. SAVING YOUR MODIFICATIONS
Place both the #memname and $memname members in the
sharedprefix.MICS.SOURCE library.
D. MAKING THE CHANGES EFFECTIVE
Run a BASPGEN from the prefix.MICS.CNTL library.
Ensure that there are no errors in MICSLOG and that the
job completes with a condition code of zero.
Run the BASPGEN job for every database unit.
ALTERNATIVE II: For implementing new date routines from
multiple units at the same time. This is
usually used at sites that previously used
the #DWMY12 member or have taken the default
in the CPLXDEF and SITE parms members.
A. CODE THE CHANGES FOR #memname AND $memname
Code the #memname and $memname members as in Parts B
and C of ALTERNATIVE I.
B. MODIFY THE #DWMY12 AND $DWMY12 MEMBERS
Change the #DWMY12 and $DWMY12 members in the
sharedprefix.MICS.SOURCE library by adding the
following statement at the end of each member:
For #DWMY12 %INCLUDE SOURCE(#memname)
For $DWMY12 %INCLUDE SOURCE($memname)
where memname is the name of your members containing
the modifications to the date routines.
These modifications are effective immediately.