User interface design in COBOL means how users see and interact with your program: batch reports, console I/O (DISPLAY and ACCEPT), or interactive screens (e.g. CICS with BMS and 3270). Good design uses clear labels, sensible field order, helpful error messages, and consistent layout. This page gives an overview of UI options in COBOL and principles that apply to each.
The user interface is what the user sees and uses. In batch, that might be a printed report: titles, columns, and totals. In an interactive program, it is the screen: where the user types (fields) and what they read (labels and messages). Designing the UI means deciding where things go, what to call them, and what to say when something goes wrong so the user can understand and correct it.
| Type | Description | Design focus |
|---|---|---|
| Batch | Reports, listings, job output | Report layout, headings, totals, column alignment |
| Console (DISPLAY/ACCEPT) | Simple terminal I/O | Clear prompts, readable output, validation messages |
| CICS / 3270 (BMS) | Form-based screens | Map layout, field order, labels, protected/unprotected, error lines |
In batch, the "interface" is the report or listing the program produces. Design includes: report title and page headers, column headings, alignment of data (numbers right-aligned, text left-aligned), control breaks and subtotals, and grand totals. Use consistent column positions and edited PICTUREs so output is readable. See Report Generation and Output Formatting for details.
DISPLAY sends data to the console (or system output). ACCEPT reads from the console (or system input). For a simple UI, use clear prompts (DISPLAY "Enter customer ID: ") before each ACCEPT, and DISPLAY error or confirmation messages after validation. Keep prompts short and place them where the user expects them. Validate input and show a clear message when input is invalid.
1234567DISPLAY "Enter customer number (1-99999): " ACCEPT WS-CUST-NUM IF WS-CUST-NUM < 1 OR WS-CUST-NUM > 99999 DISPLAY "Invalid. Please enter 1 to 99999." ELSE DISPLAY "Accepted: " WS-CUST-NUM END-IF
In CICS, screens are usually defined with BMS (Basic Mapping Support). You define a mapset and maps with field positions and attributes. BMS generates symbolic maps that your COBOL program copies in; you move data to the map fields and SEND the map, or RECEIVE into the map and read the fields. Design the map so labels are in one area (e.g. left), input fields in a consistent column, and a line reserved for messages. Use protected attributes for labels and unprotected for input. Keep the tab order logical (top to bottom, left to right).
1. For simple console input and output in COBOL, you use:
2. BMS in CICS is used for: