The FORMAT OF phrase of the PROCEDURE DIVISION creates an implicit special register, called the FORMAT OF special register, whose contents equal the FORMAT literal of the data item referenced by the identifier. The FORMAT OF special register can only be specified for data items of class date-time. The length of this special register depends on the literal or locale specified in the FORMAT phrase for the data item.
USAGE DISPLAY, PICTURE X(n)
where n equals the number of bytes of the implicit or explicit
FORMAT literal.
05 date2 FORMAT DATE IS '%d,%m,%y'.
The
following MOVE statement uses the intrinsic function CONVERT-DATE-TIME to
convert date data item date3 into the format of date data item date2. The FORMAT OF phrase creates an implicit special register whose
content would be %d,%m,%y.
MOVE FUNCTION CONVERT-DATE-TIME(date3, DATE, FORMAT OF date2)
TO alpha-num-date.
The length of the special register in
this example is 8.