Formatting COBOL code elements

Use the Formatter preference to specify preferences for formatting code in the editor. The Preview section on the right shows the effect that of the preferences specified.

Before you begin

You can refer to COBOL Code Formatter for more information.
Restriction: Indentation formatting is not available when you edit EBCDIC DBCS code.

Procedure

  1. In the Preferences window, click COBOL > Editor > Formatter. The Formatter page opens.
  2. On the Formatter page, expand the sections to see available options.
    1. Data Division
      This section contains indentation options for Data Division:
      • The Enable indentation of record descriptions is selected by default.
      • Specify an integer for Start of Area A.
      • Specify an integer for Indent length.
      • Use Align PICTURE Clauses to control whether PICTURE clauses are aligned in data element declarations. If this option is selected, an alignment column is calculated based on the length of declared data element names, so a program with short data element names will have PICTURE clauses aligned in a column to the left of a program with long data element names. This option is selected by default.
      • Use Align VALUE Clauses to control whether VALUE clauses are aligned in data element declarations. If this option is selected, an alignment column is calculated based on the length of declared data element names and VALUE clause lengths, so the alignment columns for VALUE clauses may vary from program to program. This option is selected by default.
    2. Procedure Division
      This section contains indentation options for Procedure Division:
      • The Enable indentation of procedure division is selected by default.
        Start of Area A
        Specify a column 8 to 11 used to align language elements that are required to begin in Area A. Column 8 is the default value.
        Start of Area B
        Specify a column 12 to 16 to specify the leftmost column to align language elements that are required to begin in Area B. Column 12 is the default value.
      • Select Indent multi-line statements to control whether non-block statements that span multiple lines are indented.
        Multi-line indent length
        Specify an integer from 0 to 10 as the number of spaces that all lines except the first line of a multi-line statement to be indented. The default value is 3.
      • Select Align lists to control whether lists in COBOL statements that span multiple lines are aligned. This option is selected to align the items in a statement list that spans multiple lines in the same column. It is selected by default.
      • Block indentation
        • Select Indent EXEC blocks to indent EXEC blocks.
        • Select Indent END-EXEC phrase to indent the line that contains the END-EXEC phrase with the contents of the EXEC block.
      • Select Fix length or Custom length and the associated length options to control block statement indentation.
        Fix length
        Specify the number of spaces to indent for each language element level in Area A and B. The default value is 3.
        Custom lengths
        This section allows for specifying the number of spaces to indent the listed language phrases. You can specify a value 0 to 10.
    3. Capitalization
      This section specifies the type of capitalization to be used for language elements. You can select the following capitalization options for some language elements in the editor:
      • Upper
      • Lower
      • Mixed, which is a mix of uppercase and lowercase characters, for example: FirstLast or firstLAST.
      • None

      The default value for the reserved word, user-defined word, function, date format, and compiler directive language elements is uppercase. The default value for comments is none.

    4. Line Length
      This section sets the right column to use when aligning code.
      • Indent up to the end of Area B
      • Indent past the end of Area B
      • Do not indent
      • Wrap to the next line
    5. Copybooks

      This section specifies the type of capitalization to be used for copybook code or comments in a copybook file.

  3. Click Apply to save your changes.