Twelve Month Calendar Modifications
Two varieties of Gregorian-based 12-month calendars exist:
micsrm140
Two varieties of Gregorian-based 12-month calendars exist:
- The fiscal year starts January 1.
- The fiscal year starts on the first of some other month.
Note:
MICS Accounting and Chargeback
lets you define a unique accounting calendar, separate from the global 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 most of your MICS
information. For more information before altering the global MICS
calendar, see Using Accounting and Chargeback.If your
MICS
data center has a fiscal year that begins January 1 of each year and ends 12 months later in December, you do not need to make any changes to your environment. Review member MNTHFMT of the sharedprefix.MICS.SOURCE library to ensure that it has not been changed from the default that month 1 is named 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. These considerations arise 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. For more information, see Whether to Use DWMY12 or DWMYWK1 Date Macros.
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, 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 1 of each year, the statements in MNTHFMT should be changed so that month 1 is JULY, month 2 is AUGUST.
If you need to make modifications, these changes 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.
For more information about under Thirteen Month Fiscal Year Option, see Site Characteristics (SITE). While this information 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 that are required to change the start date of your 12-month calendar.
Alternative I
For implementing new date routines one unit at a time.
- Code the complex-level cplxdef or unit-level site parameter memberIf you want to define a global, complex-level special calendar, then code the 13MONTHYEAR parameter in sharedprefix.MICS.PARMS(CPLXDEF) as described here and run sharedprefix.MICS.CNTL(CPLXGEN). The new complex-level special calendar takes 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, 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 generates code to include #memname from the #BASMSTR module and from the $BASMSTR module.For example, memname might be named DWMYSPC. Therefore a # version would exist named #DWMYSPC, which contains macro definitions that are written in SAS Macro statements. A $ version, $DWMYSPC, containing corresponding macros that are written in SAS Macro language would also exist. See Complex Option Definition (CPLXDEF), and Site Characteristics (SITE), and Whether to Use DWMY12 or DWMYWK1 Date Macros
- Code the changes for #memname and $memname
- For the #memname (which contains the date macros that are 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 that is 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; %
- For the $memname (which contains the date macros that are 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;
- Saving your modificationsPlace both the #memname and $memname members in the sharedprefix.MICS.SOURCE library.
- Making the changes effectiveRun 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 simultaneously. This action is used at sites that previously used the #DWMY12 member or have taken the default in the CPLXDEF and SITE parameters members.
- Code the changes for #memname AND $memnameCode the #memname and $memname members as in Parts B and C of ALTERNATIVE I.
- Modify the #DWMY12 AND $DWMY12 MEMBERSChange 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.