CENTSPLT parameter: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 24: Line 24:
<p>The combined parameters, CENTSPLT and BASECENT, are mutually exclusive with the <var>[[DEFCENT parameter|DEFCENT]]</var> parameter. If neither is specified, the default is DEFCENT, which is set to the century when the system was started.</p>
<p>The combined parameters, CENTSPLT and BASECENT, are mutually exclusive with the <var>[[DEFCENT parameter|DEFCENT]]</var> parameter. If neither is specified, the default is DEFCENT, which is set to the century when the system was started.</p>
<p>The following is an explanation of how the CENTSPLT parameter affects 2-digit to a 4-digit year conversions.</p>
<p>The following is an explanation of how the CENTSPLT parameter affects 2-digit to a 4-digit year conversions.</p>
<p>The base century is computed as follows: </p>
<p>The base century is handled as follows: </p>
<ul>
<ul>
<li>
<li>
Line 31: Line 31:
Then, if the last two digits of the current system date are less than the CENTSPLT value, the base century value is decremented by one.</li>
Then, if the last two digits of the current system date are less than the CENTSPLT value, the base century value is decremented by one.</li>
<li>
<li>
Store the new base century.</li>
The new base century is stored.</li>
</ul>
</ul>
<p>Some examples follow: </p>
<p>Some examples follow: </p>
<ul>
<ul>
<li>
<li>
If the current date is May 23, 1996 with CENTSPLT=50, BASECENT starts at 19 and, because 96 is greater than 50, it stays 19.</li>
If the current date is May 23, 1996 with CENTSPLT=50, BASECENT starts at 19 and, because 96 is greater than 50, BASECENT stays at 19.</li>
<li>
<li>
If the current date is May 23, 2006 with CENTSPLT=50, BASECENT starts at 20, but because 06 is less than 50, BASECENT is decremented to 19.</li>
If the current date is May 23, 2006 with CENTSPLT=50, BASECENT starts at 20, but because 06 is less than 50, BASECENT is decremented to 19.</li>
</ul>
</ul>
<p class="note"><b>Note:</b>  Because of the way the base century is calculated, you can get unexpected results if CENTSPLT is set to a value higher than the current year. If you want to maintain the current century, do not set CENTSPLT to a value higher than the current year. Consider the following scenario:</p>
<p class="note"><b>Note:</b>  Because of the way the base century is calculated, you can get unexpected results if CENTSPLT is set to a value higher than the current year. If you want to maintain the current century, do not set CENTSPLT to a value higher than the current year. </p>
<p>Consider the following scenario:</p>
<p>The current date is May 23, 1996 with CENTSPLT=97. BASECENT starts at 19, but because 96 is less than 97, BASECENT is decremented to 18.</p>
<p>The current date is May 23, 1996 with CENTSPLT=97. BASECENT starts at 19, but because 96 is less than 97, BASECENT is decremented to 18.</p>
<p>The rule of thumb here is: do not set CENTSPLT to a value higher than the current 2-digit year, if the current year is in the lower century of the range split; that is, 1996 is in the lower century in this case, so it is very unlikely that you will want to set CENTSPLT higher than the current year (96).</p>
<p>The rule of thumb here is: if the current year is in the lower century of the range split, do not set CENTSPLT to a value higher than the current 2-digit year. In this example, 1996 is in the lower century, so it is very unlikely that you will want to set CENTSPLT higher than the current year (96).</p>
[[Category:User parameters]]
[[Category:User parameters]]
[[Category:Parameters]]
[[Category:Parameters]]

Revision as of 16:58, 15 November 2013

Century year split

Summary

Default value
None
Parameter type
User
Where set
On User 0's parameter line or by any user
Related products
All
Introduced
Model 204 V6.1 or earlier

Description

The CENTSPLT parameter computes the value of the base century, the BASECENT parameter, used by the date processing routines, specifically $DATECNV and $DATEDIF, when a 2-digit year is converted to a 4-digit year.

  • If a 'YY' value is greater than or equal to the CENTSPLT value, it is assumed to be the base century described as follows.
  • If it is less than the CENTSPLT value, it is assumed to be the base-plus-1 century.

The value of CENTSPLT is decimal in the range of 00 to 99.

The combined parameters, CENTSPLT and BASECENT, are mutually exclusive with the DEFCENT parameter. If neither is specified, the default is DEFCENT, which is set to the century when the system was started.

The following is an explanation of how the CENTSPLT parameter affects 2-digit to a 4-digit year conversions.

The base century is handled as follows:

  • The base century is initially set to the century prefix of the current system date.
  • Then, if the last two digits of the current system date are less than the CENTSPLT value, the base century value is decremented by one.
  • The new base century is stored.

Some examples follow:

  • If the current date is May 23, 1996 with CENTSPLT=50, BASECENT starts at 19 and, because 96 is greater than 50, BASECENT stays at 19.
  • If the current date is May 23, 2006 with CENTSPLT=50, BASECENT starts at 20, but because 06 is less than 50, BASECENT is decremented to 19.

Note: Because of the way the base century is calculated, you can get unexpected results if CENTSPLT is set to a value higher than the current year. If you want to maintain the current century, do not set CENTSPLT to a value higher than the current year.

Consider the following scenario:

The current date is May 23, 1996 with CENTSPLT=97. BASECENT starts at 19, but because 96 is less than 97, BASECENT is decremented to 18.

The rule of thumb here is: if the current year is in the lower century of the range split, do not set CENTSPLT to a value higher than the current 2-digit year. In this example, 1996 is in the lower century, so it is very unlikely that you will want to set CENTSPLT higher than the current year (96).