Pivot Year


In installations where applications contain date fields that do not include a century component, restructuring files containing such fields, making comparisons to such fields, and calculations on these fields can produce unpredictable results. To ensure that these functions produce the desired results within APPX applications, century components should be added to these date fields or you may define a pivot year value.

By defining a pivot year, you direct APPX to determine what century a particular year belongs to. For example, if the pivot year is set to 35, then any date field with a year greater than 35 will be assumed by APPX to have a century value of 19. Any date field with a year less than or equal to the pivot year will be assumed by APPX to have a century value of 20. This pivot year value can be changed as time passes but it is important that it be set to a value best suited to your particular applications and the way they use dates.

The pivot year parameter is set in an APPX environment variable. The environment variables file, named appx.env, can be found in the APPXPATH directory. Alternatively, there may be a copy in a user’s home directory. (On Windows and NT systems, this is the C:\ directory.) If there is a copy of appx.env in a user’s home directory, its values will override the appx.env values in the APPXPATH directory, for all variables found in both places. On UNIX systems, add an “export” statement to your APPX start-up script with the appropriate setting.

APPX_PIVOT_YEAR=35                      (Windows and NT installations)
export APPX_PIVOT_YEAR=35
        (UNIX installations)

Alternatively, the APPX_PIVOT_ITEMS environment variable limits pivot logic to masked date items in input processes, without affecting ILF statements. With APPX_PIVOT_ITEMS set to a value between 1 and 99 and with APPX_PIVOT_YEAR not set, pivot year logic will be applied to dates entered with the century component masked out. Pivot year logic will not be applied to those same dates when used with ILF statements such as DATE ADD and DATE BTW. This is unlike the use of the APPX_PIVOT_YEAR variable, which applies pivot logic to both masked date input items and ILF statements. To set APPX_PIVOT_ITEMS, use the same format described for APPX_PIVOT_YEAR.