ILE COBOL Language Reference


Format 1

Format 1 is used for data description entries in all Data Division sections. Level-number in this format can be any number from 01-49, as well as 77.

Data Description Entry - General Format 1
 
>>-level-number--+-------------+-------------------------------->
                 +-data-name-1-+
                 |        (1)  |
                 '-FILLER------'
 
>--+---------------------------------------+-------------------->
   +-REDEFINES--data-name-2----------------+
   |      (2)                              |
   +-LIKE-------data-name-3--+-----------+-+
   |                         '-(integer)-' |
   |                 (2)                   |
   '-+----+--TYPEDEF-----------------------'
     '-IS-'
 
>--+------------------+--+-----------------------+-------------->
   '-+----+--EXTERNAL-'  '-BLANK--+------+--ZERO-'
     '-IS-'                       '-WHEN-'
 
>--+-------------------+--+----------------+-------------------->
   '-| FORMAT Clause |-'  '-+----+--GLOBAL-'
                            '-IS-'
 
>--+-------------------------------+---------------------------->
   '-+-JUST------+--+------------+-'
     '-JUSTIFIED-'  |       (3)  |
                    '-RIGHT------'
 
>--+------------------------------+----------------------------->
   +-| OCCURS clause - Format 1 |-+
   '-| OCCURS clause - Format 2 |-'
 
>--+------------------------------------------------------------------------+-->
   '-+-PICTURE-+--+----+--character-string--+-----------------------------+-'
     '-PIC-----'  '-IS-'                    '-| SIZE and LOCALE Phrases |-'
 
>--+-------------------------------------------------------------+-->
   '-+--------------+--+-LEADING--+--+-------------------------+-'
     '-SIGN--+----+-'  '-TRAILING-'  '-SEPARATE--+-----------+-'
             '-IS-'                              '-CHARACTER-'
 
>--+------------------------+----------------------------------->
   '-VALUE--+----+--literal-'
            '-IS-'
 
>--+----------------------------------+------------------------->
   '-+-SYNCHRONIZED-+--+------------+-'
     '-SYNC---------'  |      (3)   |
                       +-LEFT-------+
                       |       (3)  |
                       '-RIGHT------'
 
>--+------------------------+----------------------------------->
   |      (2)               |
   '-TYPE-------type-name-1-'
 
>--+-----------------------------------------------+-----------><
   '-+---------------+--+-BINARY-----------------+-'
     '-USAGE--+----+-'  +-COMPUTATIONAL----------+
              '-IS-'    +-COMP-------------------+
                        |                 (2)    |
                        +-COMPUTATIONAL-1--------+
                        |        (2)             |
                        +-COMP-1-----------------+
                        |                 (2)    |
                        +-COMPUTATIONAL-2--------+
                        |        (2)             |
                        +-COMP-2-----------------+
                        |                 (2)    |
                        +-COMPUTATIONAL-3--------+
                        |        (2)             |
                        +-COMP-3-----------------+
                        |                 (2)    |
                        +-COMPUTATIONAL-4--------+
                        |        (2)             |
                        +-COMP-4-----------------+
                        +-DISPLAY----------------+
                        |           (2)          |
                        +-DISPLAY-1--------------+
                        +-INDEX------------------+
                        +-PACKED-DECIMAL---------+
                        |         (2)            |
                        +-POINTER----------------+
                        |                   (2)  |
                        '-PROCEDURE-POINTER------'
 
 

Notes:

  1. Cannot be used with the TYPEDEF clause.

  2. IBM Extension

  3. Syntax-checked only

Data Description Entry - General Format 1 (continued)
 
>>-------------------------------------------------------------><
 
OCCURS clause - Format 1:
 
|--OCCURS--integer-2--+-------+--| key-indexed-by phrase |------|
                      '-TIMES-'
 
OCCURS clause - Format 2:
 
|--OCCURS--integer-1--TO--integer-2----------------------------->
 
>--+-------+--DEPENDING--+----+--data-name-1-------------------->
   '-TIMES-'             '-ON-'
 
>--| key-indexed-by phrase |------------------------------------|
 
key-indexed-by phrase:
 
   .-----------------------------------------------------------.
   V                                                           |
|----+-------------------------------------------------------+-+-->
     |                                       .-------------. |
     |             (1)                       V             | |
     '-+-ASCENDING-------+--+-----+--+----+----data-name-2-+-'
       |            (1)  |  '-KEY-'  '-IS-'
       '-DESCENDING------'
 
>--+-----------------------------------+------------------------|
   |                  .--------------. |
   |                  V              | |
   '-INDEXED--+----+----index-name-1-+-'
              '-BY-'
 
Size and Locale Phrases:
 
        (2)
|--SIZE-------+----+--integer-3--LOCALE--+-------------------------+--|
              '-IS-'                     '-+----+--mnemonic-name-1-'
                                           '-IS-'
 
FORMAT Clause:
 
          (2)
|--FORMAT-------+----+--+-DATE------+--+----+------------------->
                '-OF-'  +-TIME------+  '-IS-'
                        '-TIMESTAMP-'
 
>--+---------------------------------+--------------------------|
   '-+-literal-2--+--------------+-+-'
     |            '-| phrase 1 |-' |
     '-| phrase 2 |----------------'
 
phrase 1:
 
|--SIZE--+----+--integer-4--+-------------------------------------+--|
         '-IS-'             '-LOCALE--+-------------------------+-'
                                      '-+----+--mnemonic-name-2-'
                                        '-IS-'
 
phrase 2:
 
|--SIZE--+----+--integer-5--LOCALE--+-------------------------+--|
         '-IS-'                     '-+----+--mnemonic-name-3-'
                                      '-IS-'
 
 

Notes:

  1. Cannot be used with boolean data type

  2. IBM Extension

The clauses may be written in any order with three exceptions:

Not all clauses are compatible with each other. For details, see the descriptions of the individual clauses.

Clauses must be separated by a space, a separator comma, or a separator semicolon.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]