DATSEP (Date Separator) keyword for physical and logical files

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 ( ). The parameter must be enclosed in single quotation marks (').

If you specify *JOB, the default is the job attribute.

For physical files, if you do not specify the DATSEP keyword, the default is the job attribute.

For logical files, if you do not specify the DATSEP keyword, the default is the date separator from the physical file. If you did not specify the DATSEP keyword for the physical file field (*ISO, *USA, *EUR, or *JIS was specified on the DATFMT keyword), the default for DATSEP is the job attribute.

If you specify the *ISO, *USA, *EUR, or *JIS date format value on the DATFMT keyword, you cannot specify the DATSEP keyword. These formats have a fixed date separator.

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

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         DATFMT(*DMY) DATSEP('-')
00040A            DATFLD4         L         DATSEP(' ')
     A

If the current date is June 21, 1990, the current system date format value is MDY, and the system date separator value is '/', DATFLD2 contains 21-06-90. DATFLD4 contains 06 21 90.