DATA-COLUMNS (numeric)

This property describes where each column begins in the data added to the list. Columns are defined by character positions in the raw data, with the first character being position 1. For example, the following data item:

   03  NAME           PIC X(20).
   03  PHONE-NUMBER   PIC X(15).
   03  STATE          PIC X(2).

would normally be displayed in three columns, one at position 1 (NAME), one at position 21 (PHONE-NUMBER), and one at position 36 (STATE). Each time you set DATA-COLUMNS to a positive value, a new column is created at that position. Setting DATA-COLUMNS to zero clears all the existing column definitions. Note that there is always a column at position 1, so setting position 1 has no useful effect.

Typically, you specify DATA-COLUMNS by enclosing a list of columns in parentheses. This causes the compiler to generate code to set each column in turn. For example, a setting that would match the preceding example would be:

DATA-COLUMNS = ( 21, 36 )

This can also be specified with the RECORD-POSITION construct. The data item is referenced by a numeric literal whose value corresponds to the location of the data item within the record. See RECORD-POSITION for more information. For example, the above example would be:

    record-position of PHONE-NUMBER,
    record-position of STATE )

You must also specify DISPLAY-COLUMNS to get the columns to display correctly. If you don't, the results are undefined.