User's Guide

4DIGITYR

Convert a 2- or 3-digit year to 4 digits

Function:

Convert a 2- or 3-digit year to 4 digits and return the value.

Parameters:

INYEAR

Year value to be converted. The input year may be one of the following:

  2-digit year: 00-99
  3-digit year: 100-199
  4-digit year: 1900-2099

OUTYEAR

4-digit output year. The value is returned as an integer in a name variable.

Examples:

  1. LAS> 4digityr inyear=98 outyear=yr

    The input year 98 will be converted to 1998 and returned in the variable YR.

  2. LAS> 4digityr inyear=02 outyear=yr

    The input year 02 will be converted to 2002 (assuming the current year is 1998) and returned in the variable YR. See user note 1.

  3. LAS> 4digityr inyear=105 outyear=yr

    The input year 105 will be converted to 2005 and returned in the variable YR.

Description/Algorithm:

The input is compared with the allowable ranges, converted to 4 digits and returned.

Nonfatal error messages:

    None.

Fatal error messages:

  1. [4digityr-update] Error updating variable block

    An error occurred updating the TAE variable block. Contact the system administrator if problem persists.

  2. [4digityr-val] Year out of range

    The input year was outside the allowable range. Check that the input year is in the range [00,199] or [1900,2099].

User Notes:

  1. Year values between 00 and 49 are considered to begin with 19 unless the value is within 5 years of the present 2-digit year. Example: INYEAR=04 and present year is 1998 then OUTYEAR=1904 however; INYEAR=03 and present year is 1998 then OUTYEAR=2003.

  2. Year values between 100 and 199 are considered to be years since 1900 and thus are between 2000 and 2099.

  3. Year values between 1900 and 2099 are simply returned.