Date, time or timestamp expression
When the first parameter is a date time or timestamp expression, the optional format parameter specifies the format of the value returned. The converted decimal value will have the number of digits that a value of that format can have, and zero decimal positions. For example, if the first parameter is a date, and the format is *YMD, the decimal value will have six digits. If the first parameter is a timestamp with three fractional seconds, the decimal value will have 17 digits.
If the format parameter is omitted, the format of the first parameter is used. See DATFMT(fmt{separator}) and TIMFMT(fmt{separator}).
Format *USA is not allowed with a time expression. If the first parameter is a time value with a time-format of *USA, the second format parameter for %DEC must be specified.
Figure 1 shows an example of the %DEC built-in function.
For more information, see Conversion Operations or Built-in Functions.