Prevent date, time, and timestamp errors when copying files

For FMTOPT(*MAP), FROMKEY with *BLDKEY, TOKEY with *BLDKEY, and INCREL parameters, 2-digit year-date fields or values will be assumed to have a century of 19 if the year is in the range from 40 to 99, or a century of 20 if the year is in the range from 00 to 39.

For example, 12/31/91 is considered December 31, 1991, while 12/31/38 is considered December 31, 2038.

However, any from-files containing 2-digit year-date fields with actual internal date values outside the range January 1, 1940 to December 31, 2039 cause input mapping errors, and the copy operation fails.

When FMTOPT(*MAP) is used to convert or copy a from-file field date value in a 4-digit year form to a 2-digit year form, the from-file field value must be within the range of January 1, 1940 to December 31, 2039. Otherwise, a mapping error occurs, and the copy command sets the to-file field with its default value.

Likewise, when using a 4-digit year date as a record selection input string on FROMKEY with *BLDKEY or TOKEY with *BLDKEY, the value must be within the same range if the corresponding from-file field is a date field with a 2-digit year-date. Otherwise, an error occurs. INCREL record selection is the exception to this rule, as 4-digit year date values outside this range might be used for corresponding 2-digit year-date fields.

See Map considerations using Copy for details about how to handle different field types and formats.