COLUMN is a clause that sets the horizontal position (column number) where a screen or report field appears. Use it in the SCREEN SECTION with LINE (e.g. LINE 5 COLUMN 20) or in report group descriptions. Column 1 is the leftmost position. For COL and COLUMNS see COLUMN-AND-COLUMNS.
COLUMN appears in data description entries in the DATA DIVISION: in SCREEN SECTION for screen layout (each elementary item typically has LINE and/or COLUMN, or VALUE, PIC, etc.) and in report writer or report line definitions to position output fields.
12345678910SCREEN SECTION. 01 CUSTOMER-SCREEN. 05 LINE 5 COLUMN 20 VALUE "Customer ID:". 05 CUST-ID-FIELD LINE 5 COLUMN 35 PIC X(8). *> Report-style: column positions for output 01 REPORT-LINE. 05 CUST-ID-OUT PIC X(8) COLUMN 10. 05 NAME-OUT PIC X(30) COLUMN 20. 05 AMT-OUT PIC Z,ZZ9.99 COLUMN 55.
| Example | Meaning |
|---|---|
| COLUMN 1 | Field starts at the leftmost column |
| LINE 5 COLUMN 20 | Screen item at row 5, column 20 |
| COLUMN 55 | Report or screen field starts at column 55 |
In screen layouts, LINE is the row (vertical position) and COLUMN is the column (horizontal position). Together they fix where the field appears. For example LINE 8 COLUMN 25 means row 8, column 25. Omitted LINE or COLUMN may default to the current line or column depending on the implementation.
COLUMN is the “which box across” on the screen or report. LINE is “which row down.” COLUMN 1 is the first box from the left; COLUMN 40 is the 40th box from the left.
1. What does COLUMN specify?
2. In SCREEN SECTION, COLUMN is often used with which other clause?