DATSEP (Date Separator) keyword for display files

You use this field-level keyword to specify the separator character for a date field. This keyword is valid only for date fields (data type L).

The format of the keyword is:

DATSEP(*JOB | 'date-separator')

The date separator parameter specifies the separator character that appears between the year, month, and day. Valid values are a slash (/), dash (–), period (.), comma (,) or blank ( ). Single quotation marks must enclose the parameter.

If you specify the *ISO, *USA, *EUR, or *JIS date format value for the DATFMT keyword, you should not specify the DATSEP keyword. These formats have fixed date separators.

If you do not specify the DATSEP keyword and the format that is specified for DATFMT does not have a fixed date separator, DATSEP is set to *JOB as the default.

If you specify *JOB or if DATSEP is set to *JOB as the default, the high-level language and the application handle the separator as a slash (/). On output, the system converts the separator that was specified by the Date Separator Job Definition Attribute. The system converts the separator to a slash (/), as soon as the system receives the separator, before passing control to the application.

The separator for DFT, DFTVAL, and MAPVAL keyword values must match the separator the DATSEP keyword specifies. If the DATSEP keyword specifies *JOB or the DATSEP keyword is set to *JOB as default, these values must have a format of a slash (/).

The DATSEP keyword overrides the job attribute. It does not change the system default.

It is the responsibility of the high-level language and the application to format the date field according to the format specified for the DATFMT keyword and use the separators specified for the DATSEP keyword. The system does format fields on output. The system validates the date field on input according to the format that the DATFMT keyword specifies and the separator that the DATSEP keyword specifies.

Option indicators are not valid for this keyword, although option indicators can be used to condition the field for which it is specified.

Example

The following example shows how to specify the DATSEP keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A
00020A          R RECORD1
00030A            DATFLD2         L  B  5  2DATFMT(*DMY) DATSEP('-')
00040A            DATFLD4         L  B  5 22DATFMT(*JUL) DATSEP(' ')
00050A            DATFLD6         L  B  5 42DATFMT(*JOB) DATSEP(*JOB)
     A

If you want to display the date June 21, 1990, the date format defined in the Job Definition Attributes is *MDY and the date separator defined in the Job Definition Attributes is a slash (/), the following values will be displayed when RECORD1 is written.

DATFLD2    21-06-90
DATFLD4    90 172
DATFLD6    06/21/90