Every online Easytrieve transaction begins with SCREEN. The statement does not paint a single field—it defines and initiates an entire SCREEN activity: the shell that holds declarations describing what operators see, executable logic between declarations and procedures, and screen PROCs that modularize validation and file I/O. Beginners coming from batch often search for DISPLAY in JOB; SCREEN is the correct entry point for terminal work. Broadcom structures the activity as SCREEN header, declaration section, then screen procedures. Parameters on SCREEN itself control commit boundaries, uppercase translation, terminal dimensions, pop-up windows, borders, and background attributes. This guide walks through full syntax, declaration ordering rules, how activities start and end, COMMIT semantics for CICS deployments, layout pitfalls on small terminals, and how SCREEN cooperates with INITIATION, BEFORE-SCREEN, AFTER-SCREEN, and TERMINATION procedures in a complete online design.
123456SCREEN [NAME screen-name] [COMMIT (...)] + [UPPERCASE] [ROWCOUNT rows] [LINESIZE columns] + [ROW screen-start-row] [COL screen-start-column] + [BACKGROUND ATTR attribute-name] + [BORDER {SINGLE|DOUBLE|WIDE|'literal'} [ATTR ...]] + [SHADOW]
Plus signs continue the SCREEN header across source lines per Easytrieve continuation rules. NAME labels the activity for EXECUTE references and documentation—use meaningful names like EMP-INQUIRY not SCREEN1. COMMIT clauses control transaction boundaries. Layout parameters override Site Options Table defaults for this activity only.
Screen-name may be up to 128 characters. It may begin with A–Z, 0–9, or national characters (#, @, $), must not be all numeric, and may contain non-delimiter characters. PROGRAM EXECUTE SCREEN NAME and SCREEN EXECUTE SCREEN NAME jump between activities. Meaningful names appear in compile listings and audit documents operators trust during incident response.
| Parameter | What it does | Beginner note |
|---|---|---|
| ROWCOUNT | Override row count for this screen | Test on smallest shop terminal |
| LINESIZE | Override column count | Pop-up when less than physical terminal |
| ROW / COL | Start position on display | Default row 1 column 1 |
| UPPERCASE | Uppercase input before logic | Simplifies alpha comparisons |
| BORDER | Frame around screen | SINGLE DOUBLE WIDE or one-char literal |
| SHADOW | Shadow presentation effect | Release-specific attribute support |
When LINESIZE and ROWCOUNT are smaller than the physical terminal, Easytrieve displays the screen as a pop-up window over prior content. Fields visible from previous screens that remain underneath receive ASKIP—operators cannot type into stale panels. In TSO and CMS with dual presentation sizes, Easytrieve selects presentation size from screen dimensions. Design modal dialogs—confirm delete, error detail—with explicit smaller ROWCOUNT; design full-screen menus with dimensions matching default terminal to avoid accidental ASKIP on underlying data entry rows.
After the SCREEN header, declarations describe panel content. DEFAULT must appear first—it sets baseline attributes for fields unless ROW or KEY overrides. TITLE supplies screen title text. ROW places literals and fields at coordinates. KEY defines PF keys with NAME text and actions EXIT, IMMEDIATE, or procedure targets. KEY, TITLE, and ROW may follow DEFAULT in any order per Broadcom, though teams often group TITLE then ROWs then KEYs for readability.
12345678910111213SCREEN NAME MAIN-MENU UPPERCASE ROWCOUNT 24 LINESIZE 80 BORDER DOUBLE DEFAULT ATTR (GREEN NEUTRAL) TITLE 'Employee Maintenance Menu' ROW 6 COL 10 'Enter option:' ROW 8 COL 12 WS-MENU-OPT VALUE ('V' 'E' 'X') + ERROR 'Valid options: V E X' ROW 10 COL 14 'V — View' ROW 11 COL 14 'E — Edit' KEY F1 NAME 'Help' IMMEDIATE KEY F3 NAME 'Exit' EXIT KEY F12 NAME 'Cancel' EXIT IMMEDIATE
EXECUTE from PROGRAM or another SCREEN starts a named activity. If the program has no PROGRAM activity, the first SCREEN in source order executes automatically when the run begins. INITIATION procedure runs once at activity start before the first display cycle.
Processing continues until EXIT, STOP, or TRANSFER. Broadcom compiles an error if none appear— infinite screen loops strand operators. EXIT ends the SCREEN activity normally. STOP may end broader execution depending on context. TRANSFER passes control per online runtime. Distinguish EXIT from STOP EXECUTE which halts all Easytrieve execution abnormally.
| Option | Meaning | Default |
|---|---|---|
| COMMIT ACTIVITY | Commit at normal activity end | NOACTIVITY |
| COMMIT NOACTIVITY | No commit at activity end | Yes — default |
| COMMIT TERMINAL | Commit around terminal I/O | Yes — default; pseudo-conversational on CICS |
| COMMIT NOTERMINAL | Suppress commit on each terminal I/O | Off |
Explicit COMMIT and ROLLBACK inside procedures provide finer control when shop standards require multiple units of work within one SCREEN activity. Coordinate with DBA on Db2 cursor and hold behavior when mixing COMMIT TERMINAL with file UPDATE.
Special-name procedures bracket runtime: INITIATION, BEFORE-SCREEN, AFTER-SCREEN, TERMINATION. User-defined PROC names modularize shared validation. Procedures may appear in any order after declarations though maintenance teams group special names predictably. Broadcom restricts certain statements in specific procedures—study BEFORE-SCREEN and AFTER-SCREEN pages before placing GOTO SCREEN or file GET in wrong hooks.
JOB loops on file records with automatic INPUT. SCREEN responds to operator events. Both share Library. Pattern: SCREEN updates approval flag on master, EXECUTE JOB PRINT-APPROVAL-RPT reuses batch REPORT definitions. SCREEN statement names the online half; JOB names the batch half—do not merge them into one activity type.
The SCREEN statement is the title page of a workbook for one computer form. It says the form name, how big the paper is, and whether letters you type become capitals. Inside the workbook you draw the lines and boxes (declarations), write what happens when someone fills it out (procedures), and say how to close the workbook when done (EXIT).
1. SCREEN statement defines:
2. Declaration order rule:
3. SCREEN activity must end with:
4. UPPERCASE on SCREEN:
5. LINESIZE and ROWCOUNT smaller than terminal produce: