Use this field-level keyword to specify the format of a date field. This keyword is valid only for date fields (data type L) or for logical file zoned fields (data type S), packed fields (data type P), or character fields (data type A) whose corresponding physical file fields are date fields (data type L).
DATFMT(date-format)
The date-format parameter specifies the format for the date. The following table describes the valid date formats and their default separator values for physical file fields.
|
The following table describes the valid date formats and their default separator values for logical files.
Format name | Date format parameter | Date format | Zoned or character field length | Zoned or character example | Packed field length | Packed example (in Hex) |
---|---|---|---|---|---|---|
Job default | *JOB | |||||
Month/Day/Year | *MDY | mmddyy | 6,0 | 062196 | 6,0 or 7,0 | '0062196F'X |
Day/Month/Year | *DMY | ddmmyy | 6,0 | 210696 | 6,0 or 7,0 | '0210696F'X |
Year/Month/Day | *YMD | yymmdd | 6,0 | 960621 | 6,0 or 7,0 | '0960621F'X |
Month/Day/Year (4 digit year) | *MDYY1 | mmddyyyy | 8,0 | 06211996 | 8,0 or 9,0 | '006211996F'X |
Day/Month/Year (4 digit year) | *DMYY1 | ddmmyyyy | 8,0 | 21061996 | 8,0 or 9,0 | '021062006F'X |
Year/Month/Day (digit year) | *YYMD1 | yyyymmdd | 8,0 | 19960621 | 8,0 or 9,0 | '019960621F'X |
Julian | *JUL | yyddd | 5,0 | 96172 | 5,0 | '96172F'X |
Julian (4 digit year) | *LONGJUL1 | yyyyddd | 7,0 | 1996172 | 7,0 | '1996172F'X |
Century/Day/Month/Year | *CMDY1 | cmmddyy | 7,0 | 0062196 | 7,0 | '0062196F'X |
Century/Day/Month/Year | *CDMY1 | cddmmyy | 7,0 | 1210696 | 7,0 | '1210696F'X |
Century/Year/Month/Day | *CYMD1 | cyymmdd | 7,0 | 1960621 | 7,0 | '1960621F'X |
Month/Year | *MY1,2 | mmyy | 4,0 | 0696 | 4,0 or 5,0 | '00696F'X |
Year/Month | *YM1,2 | yymm | 4,0 | 9606 | 4,0 or 5,0 | '09606F'X |
Month/Year (4 digit year) | *MYY1,2 | mmyyyy | 6,0 | 061996 | 6,0 or 7,0 | '0061996F'X |
Year/Month (4 digit year) | *YYM1,2 | yyyymm | 6,0 | 199606 | 6,0 or 7,0 | '0199606F'X |
International Standards Organization | *ISO | yyyymmdd | 8,0 | 19960621 | 8,0 or 9,0 | '019960621F'X |
IBM USA Standard | *USA | mmddyyyy | 8,0 | 19960621 | 8,0 or 9,0 | '006211996F'X |
IBM European Standard | *EUR | ddmmyyyy | 8,0 | 21061996 | 8,0 or 9,0 | '021061996F'X |
Japanese Industrial Standard Christian Era | *JIS | yyyymmdd | 8,0 | 19960621 | 8,0 or 9,0 | '019960621F'X |
Notes:
|
The following example shows how to specify the DATFMT keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A 00020A R RECORD 00030A DATFLD1 L DATFMT(*JUL) 00040A DATFLD2 L DATFMT(*EUR) A
If the current date is June 21, 1990, the current system date format value is MDY, and the current system separator is /, DATFLD1 contains 90/172 (the 172nd day of the year 1990). DATFLD2 contains 21.06.1990.