BaseYear: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Created page with "A '''BaseYear''' BRConfig.sys specification specifies the starting year of a 100-year window that Business Rules! will treat as the default century for the Days function w...")
 
Line 2: Line 2:


====Start-up Default====
====Start-up Default====
BaseYearnumber
BaseYearnumber


If the century is not included in the Days value, Business Rules! assumes that all dates fall into the 100-year window specified by BaseYear. In cases where the 100 year window spans two different centuries, the year of the date passed by Days (00-99) is compared to the last 2 digits of BaseYear. If the year passed is equal to or greater than the last 2 digits in BaseYear, the century specified in BaseYear is assumed. If the year passed is less than the last two digits in BaseYear, the first century following the year specified in BaseYear is assumed.
If the century is not included in the Days value, Business Rules! assumes that all dates fall into the 100-year window specified by BaseYear. In cases where the 100 year window spans two different centuries, the year of the date passed by Days (00-99) is compared to the last 2 digits of BaseYear. If the year passed is equal to or greater than the last 2 digits in BaseYear, the century specified in BaseYear is assumed. If the year passed is less than the last two digits in BaseYear, the first century following the year specified in BaseYear is assumed.

Revision as of 15:08, 8 April 2013

A BaseYear BRConfig.sys specification specifies the starting year of a 100-year window that Business Rules! will treat as the default century for the Days function when the century is not otherwise specified. BaseYear may also be executed from within a program with the Config BaseYear command. The format is as follows, where "number" must be a value from 1900 to 2399. The default is 1900.

Start-up Default

BaseYearnumber

If the century is not included in the Days value, Business Rules! assumes that all dates fall into the 100-year window specified by BaseYear. In cases where the 100 year window spans two different centuries, the year of the date passed by Days (00-99) is compared to the last 2 digits of BaseYear. If the year passed is equal to or greater than the last 2 digits in BaseYear, the century specified in BaseYear is assumed. If the year passed is less than the last two digits in BaseYear, the first century following the year specified in BaseYear is assumed.

Changing the value of BaseYear does not affect the "logical" value returned by the Days function. The returned value is still the number of days since January 0, 1900.

Important note

Dates prior to BaseYear can no longer be entered in M/D/Y format, as they will assume the next century. This does not affect dates already entered and converted to days. For example those stored in a history file would not be affected. If your application must work with dates wider than a 100-year range, the dates should be changed to show the century.

Examples

DATE("*MDY")     ! set default format
CONFIG BaseYear 1950
Print Days(010122)  ! assumes 01/01/2022
Print Days(010193)  ! assumes 01/01/1993

How it affects current applications

By simply placing BaseYear 1910 in your BRConfig.sys file, all dates entered and processed with the Days function will assume the 21st century for dates between 01/01/00 and 12/31/09. If you always use the results from the Days function when comparing dates, your programs should require no changes to continue working into the next century.