HELP: Convert from an ISO-8601 date string to a date/timestamp field
TYPE: OBJECT
SYNTAX: TO(FORMAT.{STR(PATTERN='str',CHRSET=num/NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,PAD=num,WIDTH=num)/BCD(TYPE=UNPACKED/PACKED/ZONED,PATTERN='str')/DEC(ENDIAN=SYSTEM/BIG/LITTLE/LOCAL,SIZE=num,PATTERN='str')/INT(SIZE=num,ENDIAN=SYSTEM/BIG/LITTLE/LOCAL,EPOCH=UNIX/LILIAN/J2000,UNIT=SS/MS/US/NS/DS)},NULLVAL='str')
This object converts an ISO-8601 formatted UTF-8 date string from the FL5 pipeline back into an external byte encoding (string, BCD zoned/packed, or binary integer).
The PATTERN parameter inside each FORMAT sub-object specifies the external byte output format using the same pattern tokens as on the read side (YYYY, MM, DD, DDD, HH, HH12, MI, SS, sss, ssssss, and literal separators). The component auto-detects the ISO-8601 format of the incoming pipeline string -- no OUTFMT parameter is needed or supported.
There is no OUTFMT parameter. The canonical pipeline input is always ISO-8601 UTF-8, produced by the read-side converter. Using the same PATTERN value on the write side as on the read side ensures a lossless round-trip: TYPE.DATE(FORMAT.BCD(TYPE=PACKED PATTERN='YYYYMMDD')) Read: 5 bytes packed BCD -> "2026-04-28" (neutral ISO) Write: "2026-04-28" -> 5 bytes packed BCD
Information loss on write is acceptable: PATTERN='YYYY' would discard the month and day, writing only the year component.
NULLVAL sets the byte pattern emitted for null/empty input values.
STRING: NULLVAL='str' - Output byte pattern for NULL/empty input values [none]