Date formats

There is no worldwide standard for the presentation of dates. Therefore, the date format should always be stored externally as part of the textual data.

The valid date formats on the operating system are:

Note: Some operating system functions do not support all of the previous date formats.

In database files, dates can be stored as:

When you store dates as numeric data, your application needs to specify the format in which it is stored and presented.

When you store dates as data type DATE (L), you can specify the format with the DDS keyword DATFMT on the database file. The date is shown in this predefined format as character data, including the date separators.

If date sorting and other processing is needed, the date should be stored in *ISO format (YYYY-MM-DD) and converted to another format during the input and output operations. Write a high-level language routine to convert dates.

Related concepts
Set job attributes (QSETJOBATR) system value
DATFMT