Previous Topic: Picture (Numeric/Text, Numeric/Character)Next Topic: Time


Date

Input editing of dates attempts to extract the information from the input field and compute an internal value comprised of either the year, month, and day in the form YYYYMMDD or the century, year, month, and day in the form CYYMMDD. Each component part of the date edit pattern specifies one or more portions of this value, either directly or by derivation.

For example, the YYYY edit pattern component directly supplies the year portion of the YYYYMMDD format, or both the century and year of the CYYMMDD format.

Overlap exists between many components used to specify dates. This overlap comes in the derivation of the internal value based on the component. For example, JJJ specifies the sequence number of days since the first day of the calendar, which implies the month and day of the month. If the JJJ specifier is used with the MM, or DD, or both specifiers, then duplicate or overlapping specifications exist.

When a date edit pattern contains overlapping specifications, then all of the overlapping specifications must be in agreement. Any overlapping specifications that conflict are flagged in error, in a left to right scan. This means that the first specification is assumed to be correct, and that any subsequent overlap that is in disagreement is flagged as an error. The actual error may be the first component, but editing has no way of knowing this.

Date components may be omitted from an edit pattern that is necessary to fully derive the internal date format (YYYYMMDD or CYYMMDD). When this happens, the internal values must be defaulted. Note that these defaults apply to computing the INTERNAL value from specifiers that are OMITTED from the EDIT PATTERN. If the specifiers are used in the edit pattern, and the user omits values for them in the input string, then the pattern flags the value as an error. The error occurs because the user did not enter all of the values specified in the edit pattern.

The following list details the default rules:

The following table illustrates date input editing behavior.

Presentation

Edit Pattern

Internal Date (YYYYMMDD)

Internal Date (CYYMMDD)

05/28/00

MM/DD/YYYY

20000528

0000528

05/28/0

MM/DD/YYYY

20000528

0000528

Jan 2, 2000

MA DD, YYYY

20000102

0000102

Jan 2, 00

MA DD, YYYY

20000102

0000102

January 2000

MN YYYY

20000101

0000101

Jan 00, Wed

MA YY, DA

20000103

0000103

00/00

YY/MM

00000000

0000000