IBM Extension

FORMAT Clause

The FORMAT clause specifies the general characteristics and editing requirements of an elementary date, time, or timestamp item.

Read syntax diagramSkip visual syntax diagram
FORMAT Clause - Format

>>-FORMAT--+----+--+-DATE------+--+----+------------------------>
           '-OF-'  +-TIME------+  '-IS-'   
                   '-TIMESTAMP-'           

>--+-----------------------------+-----------------------------><
   '-+-literal-2--| phrase 1 |-+-'   
     '-| phrase 2 |------------'     

phrase 1

|--SIZE--+----+--integer-4--+-------------------------------------+--|
         '-IS-'             '-LOCALE--+-------------------------+-'   
                                      '-+----+--mnemonic-name-1-'     
                                        '-IS-'                        

phrase 2

|--SIZE--+----+--integer-5--LOCALE--+-------------------------+--|
         '-IS-'                     '-+----+--mnemonic-name-2-'   
                                      '-IS-'                      

The FORMAT clause must be specified for every elementary date, time, or timestamp item, except the subject of a RENAMES clause.

Start of change If the SIZE phrase is not specified for a timestamp item, the size defaults to 26. If it is specified, it must have a value of 19, or a value between 21 and 32. End of change

Start of change literal-2 and the LOCALE phrase cannot be specified for a timestamp item. A timestamp has a fixed format, which is dependent on the size of the timestamp item. End of change

If literal-2 or the LOCALE phrase is not specified for a date or time item, the format of the item is determined from the SPECIAL-NAMES FORMAT clause.

A data item of class date-time cannot be reference modified.

When the FORMAT clause is specified, the following clauses cannot be specified:
The following general rules apply:
literal-2
Specifies the format of a date or time item. Literal-2 must be a non-numeric literal, at least 2 characters long. The contents of literal-2 is made up of separators and conversion specifiers. For a list of valid conversion specifiers, see Table 1. For further rules on the contents of literal-2, see the description of the FORMAT clause used in the SPECIAL-NAMES paragraph in FORMAT Clause.
Related Information
End of IBM Extension