DDS Data Types and FORMAT Literal Equivalent

In DDS, a date data type's format is specified with the DATFMT parameter. Valid DATFMT parameters include *MDY and *ISO. Along with the DATFMT keyword, a DATSEP keyword specifies a one-character value to be used as a separator between the month, day, and year value. A complete list of DATFMT parameters and their allowed DDS Date separators, along with their COBOL format literal equivalents, is shown in Table 1.

In DDS, a time data type's format is specified with the TIMFMT parameter. Valid TIMFMT parameters include *HMS and *ISO. Along with the TIMFMT keyword, a TIMSEP keyword specifies a one-character value to be used as a separator between the hours, minutes, and second value. A complete list of TIMFMT parameters and their allowed DDS Time separators, along with their COBOL format literal equivalents, is shown in Table 2.

Table 1. DDS Date Data Types and Their Equivalent ILE COBOL Format
IBM® i Format COBOL-Generated Format Description Format Valid Separators Length
*MDY %m/%d/%y Month/Day/Year mm/dd/yy /-.,space 8
*DMY %d/%m/%y Day/Month/Year dd/mm/yy /-.,space 8
*YMD %y/%m/%d Year/Month/Day yy/mm/dd /-.,space 8
*JUL %y/%j Julian yy/ddd /-.,space 6
*ISO @Y-%m-%d International Standards Organization yyyy-mm-dd - 10
*USA %m/%d/@Y IBM USA Standard mm/dd/yyyy / 10
*EUR %d.%m.@Y IBM European Standard dd.mm.yyyy . 10
*JIS @Y-%m-%d Japanese Industrial Standard Christian Era yyyy-mm-dd - 10
Table 2. DDS Time Data Types and Their Equivalent ILE COBOL Format
IBM i Format COBOL-Generated Format Description Format Valid Separators Length
*HMS %H:%M:%S Hours:Minutes:Seconds hh:mm:ss :.,space 8
*ISO %H.%M.%S International Standards Organization hh.mm.ss . 8
*USA %I:%M @p IBM USA Standard. AM and PM can be any mix of upper and lower case. hh:mm AM or hh:mm PM : 8
*EUR %H.%M.%S IBM European Standard hh.mm.ss . 8
*JIS %H:%M:%S Japanese Industrial Standard Christian Era hh:mm:ss : 8