Easytrieve gives you two constant worlds. Named constant fields are working storage locations you DEFINE with VALUE—TAX-RATE, MAX-RECS, OK-CODE. System constants are reserved words the product understands in IF field class conditions, MOVE statements, and file logic: ZERO, ZEROS, ZEROES, SPACE, SPACES, HIGH-VALUES, LOW-VALUES, EOF, DUPLICATE, and FIRST-DETAIL. You do not DECLARE ZERO as a field. You write IF GROSS NOT ZERO or MOVE SPACES TO OUT-NAME. Each system constant has rules about which field types it applies to and what bytes it represents on z/OS. Misusing HIGH-VALUES on a packed amount or testing ZERO on a blank name field produces logic bugs that compile cleanly. This overview maps every major constant family, points to detail pages, and contrasts system constants with VALUE constant fields from the field definitions chapter.
| Aspect | Constant field (VALUE) | System constant |
|---|---|---|
| Declaration | DEFINE TAX-RATE W 3 P 4 VALUE 0.0825 | No DEFINE—reserved word |
| Typical use | Business rates, codes, limits | IF tests, MOVE fill, EOF checks |
| Examples | MAX-RECS, DFLT-STAT | ZERO, SPACE, HIGH-VALUES, EOF |
| Can rename | You choose field name | Fixed vocabulary |
IF field-name class tests whether a field contains a class of data. No relational operator appears—syntax is IF NAME ALPHABETIC or IF GROSS NOT ZERO. NOT inverts the test. Each constant inspects bytes differently.
| Constant | What is tested | Detail page |
|---|---|---|
| ALPHABETIC | Letters A–Z or space in each byte | Literals and data types |
| NUMERIC | Digits in format for field type including valid sign on N and P | Numeric data type |
| SPACE, SPACES | Space character in each byte | constants/space |
| ZERO, ZEROS, ZEROES | Zero value per field type | constants/zero |
| HIGH-VALUES | X'FF' in each byte | constants/high-values |
| LOW-VALUES | X'00' in each byte | constants/low-values |
12345678JOB INPUT PAYFILE IF NAME ALPHABETIC IF EMPL# NUMERIC IF GROSS NOT ZERO PRINT DETAIL-RPT END-IF END-IF END-IF
MOVE and assignment accept system constants as sources. MOVE ZERO TO WS-COUNT clears a numeric counter. MOVE SPACES TO OUT-NAME blanks an output name before PUT. MOVE HIGH-VALUES TO KEY-FIELD sets sort-high keys for VSAM positioning in shop patterns. MOVE LOW-VALUES initializes binary areas. Targets must match constant semantics—do not MOVE SPACES to packed amount expecting numeric zero.
EOF file-name tests end of file during RETRIEVE and JOB INPUT loops. DUPLICATE signals duplicate key on indexed or VSAM adds per file status handling. Combine with file-name:FILE-STATUS for robust error branches. FIRST-DETAIL appears in report control break context—marks first detail line after a break. Detail pages cover each constant.
12345678JOB INPUT PAYFILE IF EOF PAYFILE DISPLAY 'END OF PAYFILE' END-IF IF PAYFILE:FILE-STATUS NOT ZERO DISPLAY 'I/O ERROR' PAYFILE:FILE-STATUS STOP END-IF
System constants are type-aware for ZERO and NUMERIC tests. Packed GROSS ZERO checks packed zero—not the same bytes as alphabetic field filled with character 0. SPACE tests all blanks on alphabetic fields; use ZERO for numeric zero. HIGH-VALUES and LOW-VALUES are byte tests independent of numeric type—useful for initialized key areas and flag bytes.
Broadcom accepts synonyms: ZERO, ZEROS, ZEROES; SPACE, SPACES. Choose one spelling per shop coding standard for readability. All forms invoke the same semantics in field class conditions per CA-Easytrieve Plus reference material.
FIRST-DETAIL helps TITLE and LINE procedures detect first detail after control break. BWZ on MASK blanks numeric fields when zero at print time—related to ZERO display semantics but a MASK option not a constant. SUM and control totals skip or include zero values per field definition decimals.
NULL handling in Easytrieve ties to SQL and varying fields in database access—see constants/null detail page. Distinct from LOW-VALUES binary init and from SPACE blank fill on character fields.
Release-to-release, reserved word lists grow slowly. Constants-by-release and deprecated-constants pages document migrations from legacy CA-Easytrieve Plus manuals to Broadcom 11.6. When upgrading compilers, scan for obsolete spellings in migrated macros.
System constants are magic words the teacher already knows. When you say IF CUP ZERO, the teacher checks if the cup has no marbles left—in the right way for that cup type. Named constant fields are labels you put on your own jar at home. Both are about special values, but magic words are built into the game rules; jars are yours to name.
1. ZERO in IF GROSS ZERO is:
2. HIGH-VALUES tests each byte for:
3. MOVE SPACES TO NAME fills NAME with:
4. EOF PAYFILE in IF tests:
5. Constant fields with VALUE differ from system constants because: