Use this field-level keyword to specify the separator character for a date field. This keyword is valid for only 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 cannot specify the DATSEP keyword. These formats have fixed date separators.
If you do not specify the DATSEP keyword and the format that DATFMT specifies does not have a fixed date separator, DATSEP is set to *JOB as default.
If you specify *JOB or if DATSEP defaults to *JOB, the high-level language and the application will handle the separator as a slash (/). On output the system converts the separator that was specified by the Date Separator Job Definition Attribute. On input the system converts the separator to a slash (/) before it passes control to the application.
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 to use the separators specified for the DATSEP keyword. The system does not 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.
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 /, the following values will be displayed when RECORD1 is written.
DATFLD2 21-06-90 DATFLD4 90 172 DATFLD6 06/21/90