A SCREEN activity is only useful when operators see the right labels in the right places and type into the right boxes. Screen fields are those boxes and labels—Library DEFINE variables referenced on ROW declarations with row and column coordinates, lengths implied by field definitions, and attributes controlling whether the operator can type, must type, sees numeric keyboard behavior, or views protected output from master files. DEFAULT sets baseline presentation for all fields unless a specific ROW overrides with ATTR. Beginners confuse batch PRINT columns with screen ROW placement; they are unrelated coordinate systems. This page teaches screen field layout for terminal design: ROW and COL syntax, continuing ROW lines, literals versus fields, input versus output patterns, common attribute keywords, VALUE and ERROR on input fields, RESET behavior between screen cycles, and maintenance habits that keep panel maps readable when applications grow to dozens of fields across multiple SCREEN activities.
1ROW row-number [COL column-number] 'literal-text' [field-name] [ATTR (...)] [VALUE (...)] [ERROR 'message']
ROW 8 COL 10 places content at row eight column ten. Omitting COL on subsequent ROW lines continues at same column as prior ROW in some layouts—Broadcom examples show ROW 10 COL 22 followed by ROW COL 22 for aligned menu text without repeating COL. Literals appear in quotes; field-names reference DEFINE working storage. Plus sign continues long ROW definitions across lines for VALUE and ERROR clauses.
Every screen field needs Library DEFINE: length, type, and optional RESET. Screen display width matches field length unless ATTR or mask formatting changes presentation. Numeric DEFINE with NUMERIC attribute on ROW restricts terminal keyboard. Alphanumeric fields accept broader input unless VALUE limits allowed characters. Prefix screen-only fields SCR- or WS-SCR- to distinguish from batch file fields in mixed programs.
1234DEFINE SCR-ACCT W 10 N RESET DEFINE SCR-NAME W 30 A DEFINE SCR-BAL W 12 P 2 DEFINE SCR-OPT W 1 A RESET
| Role | Typical attributes | Populated by |
|---|---|---|
| Input | MUSTENTER, VALUE, NUMERIC | Operator typing; AFTER-SCREEN reads |
| Output | ASKIP, NEUTRAL or GREEN | BEFORE-SCREEN MOVE from files |
| Label | ASKIP on literal text | Literal in ROW quotes |
| System message | ASKIP, RED or YELLOW | Validation sets ERROR or MSG field |
123456789SCREEN NAME ACCT-INQ DEFAULT ATTR (GREEN NEUTRAL) TITLE 'Account Inquiry' ROW 5 COL 5 'Account Number:' SCR-ACCT NUMERIC MUSTENTER ROW 7 COL 5 'Customer Name:' SCR-NAME ASKIP ROW 9 COL 5 'Balance:' SCR-BAL ASKIP ROW 11 COL 5 'Status:' SCR-STAT ASKIP ROW 20 COL 5 'Message:' SCR-MSG ASKIP ATTR (YELLOW NEUTRAL)
SCR-ACCT is input: operator enters account number, NUMERIC restricts keys, MUSTENTER requires entry before proceed. SCR-NAME, SCR-BAL, SCR-STAT are output: BEFORE-SCREEN READs master and MOVEs values; ASKIP prevents overwrite. SCR-MSG shows validation or not-found text in yellow.
DEFAULT ATTR (GREEN NEUTRAL) applies green neutral intensity to all fields lacking explicit ATTR. Individual ROW entries override: ATTR (RED NEUTRAL) on error message row. DECLARE statement defines reusable attribute names like ERROR-ATTR combining RED REVERSE—reference DECLARE name in ROW ATTR clause for consistency across screens.
| Attribute | Effect on field |
|---|---|
| ASKIP | Protected—no operator input |
| NUMERIC | Numeric input only |
| MUSTENTER | Field must be filled before proceed |
| MUSTFILL | Every position in field must contain character |
| INVISIBLE | Field not displayed (password-style) |
| TRIGGER | Field triggers action when filled per release rules |
| ALARM | Audible alarm when field highlighted in error |
12ROW 8 COL 10 WS-REPLY VALUE ('V' 'E' 'D' 'X') + ERROR 'Please type V, E, D, or X'
VALUE lists allowed single-character or string inputs. When operator types disallowed value, ERROR message displays and screen redisplays per validation rules. Combine VALUE with AFTER-SCREEN IF for business validation VALUE cannot express—date range checks, cross-field rules, database existence tests.
DEFINE RESET fields reinitialize before BEFORE-SCREEN each iteration. Input fields with RESET clear prior transaction typing—desirable for fresh entry screens. Output fields with RESET blank unless BEFORE-SCREEN repopulates—avoid RESET on output you expect to persist across redisplay unless intentional. Document RESET on each screen field in design specs to prevent AFTER-SCREEN flags cleared unexpectedly.
Menu screens align option letters with repeated ROW COL continuation. Data entry forms align labels at COL 5 and fields at COL 25 for scanability. Keep field lengths visible on design grid—ten-byte account field at COL 25 occupies columns 25–34; next label must start at 36 or later to avoid overlap. TITLE row consumes header space—start data ROW below title and border.
When SCREEN uses smaller ROWCOUNT for pop-up, fields from underlying full-screen remain visible but receive ASKIP automatically. Design pop-up fields within pop-up dimensions only; do not reference underlay input fields in pop-up AFTER-SCREEN without understanding they are protected.
Screen fields are labeled blanks on a worksheet. ROW and COL say which line and which space the blank is on. ASKIP means you can only look, not write. MUSTENTER means you must write something before turning the page. DEFAULT is the pen color everyone uses unless one box gets a special color.
1. Screen fields are placed primarily with:
2. DEFAULT on SCREEN:
3. ASKIP attribute means:
4. NUMERIC on a field:
5. Output-only master data on screen typically uses: