HIGH-VALUES is Easytrieve's all-bits-on figurative constant. For a normal single-byte or MIXED-format field, it represents hexadecimal FF in every byte. IF KEY-FIELD HIGH-VALUES checks whether the complete field has that pattern. MOVE HIGH-VALUES TO KEY-FIELD fills the complete receiving field with X'FF'. This byte-oriented behavior makes HIGH-VALUES useful as a collating-high sentinel, an “unassigned high key” marker, and a diagnostic pattern in legacy files. It does not mean the largest valid packed decimal amount, the highest date, the last record in a file, or end-of-file. Moving X'FF' into a numeric field can create invalid numeric data and an arithmetic abend when the field is later used. This tutorial explains storage, class conditions, MOVE semantics, EBCDIC comparisons, file keys, DBCS handling, validation, and safe design patterns for beginners.
A byte contains eight bits. X'FF' means all eight are one: binary 11111111. HIGH-VALUES repeats that byte across the subject or receiver. A four-byte field therefore contains X'FFFFFFFF' after MOVE HIGH-VALUES. An eight-byte key contains sixteen hexadecimal F digits. The constant expands to the field length, so you do not manually code a different hexadecimal literal for every receiver.
12345678DEFINE HIGH-KEY W 8 A DEFINE END-SW W 1 A MOVE HIGH-VALUES TO HIGH-KEY IF HIGH-KEY HIGH-VALUES END-SW = 'Y' END-IF
After MOVE, all eight bytes of HIGH-KEY are FF. The class test succeeds because every byte matches. If one byte is changed to an ordinary character, the test becomes false.
The documented pattern is IF field-name [NOT] HIGH-VALUES. It is also available in DO WHILE and DO UNTIL field-class conditions. NOT reverses the result: IF KEY NOT HIGH-VALUES means at least one position differs from FF. The test is not an equality comparison to a named field, so no EQ operator is needed.
1234567IF CUSTOMER-KEY HIGH-VALUES DISPLAY 'HIGH KEY SENTINEL FOUND' ELSE IF CUSTOMER-KEY NOT HIGH-VALUES DISPLAY 'ORDINARY KEY' END-IF END-IF
Broadcom 11.6 says HIGH-VALUES tests X'FF' in each byte of single-byte and MIXED-format subjects and in each double byte of DBCS subjects. That distinction matters in multilingual files. Do not split a double-byte character field into arbitrary single-byte overlays and assume the same interpretation. Define the field with its actual format so Easytrieve applies the documented class rule.
Format 2 of MOVE accepts HIGH-VALUES as the sending data area and one or more receiving fields. The first receiver determines the default sending length, while each target is filled according to the statement rules. Use it when the byte pattern itself is intended, not merely because you want a “large value.”
123456DEFINE FROM-KEY W 10 A DEFINE THRU-KEY W 10 A DEFINE HOLD-KEY W 10 A MOVE LOW-VALUES TO FROM-KEY MOVE HIGH-VALUES TO THRU-KEY HOLD-KEY
This initializes an inclusive character-key range from the lowest byte pattern through the highest. Whether a specific access method accepts these sentinels depends on its key rules, collating sequence, and application protocol. Test with representative VSAM or sequential data rather than assuming every database interprets raw FF as a valid key.
| Field kind | MOVE HIGH-VALUES result | Use for a valid maximum |
|---|---|---|
| A character key | FF in every byte; useful sentinel | HIGH-VALUES if protocol permits |
| P packed decimal | FF digits and sign pattern; often invalid | Typed decimal literal fitting digits |
| N zoned decimal | FF bytes; not valid zoned digits | All 9 digits with valid sign |
| B binary quantity | All bits one; may mean -1 when signed | Numeric limit for signedness and length |
| Date stored as digits | Not a valid calendar date | Business date such as 99991231 if allowed |
Packed decimal stores digits in nibbles and a sign in the final nibble. F is not a valid decimal digit in each position. Zoned decimal also expects digit zones. A binary field filled with FF commonly represents -1 in two's-complement signed interpretation, which is the opposite of “largest positive number.” Always choose a type-aware numeric literal when arithmetic follows.
Sequential match and merge programs sometimes need a key that sorts after every ordinary business key. At EOF on one file, logic can move HIGH-VALUES to its current key, allowing a comparison loop to continue with the remaining file. This is an algorithmic sentinel, not Easytrieve's EOF status itself. The design is safe only if real input keys can never contain all FF bytes and if comparison uses a compatible collating sequence.
1234567891011IF EOF FILE-A MOVE HIGH-VALUES TO FILE-A-HOLD-KEY END-IF IF EOF FILE-B MOVE HIGH-VALUES TO FILE-B-HOLD-KEY END-IF IF FILE-A-HOLD-KEY LT FILE-B-HOLD-KEY PERFORM PROCESS-A END-IF
EOF remains the condition that detects file exhaustion. HIGH-VALUES merely supplies a key value for the comparison algorithm after exhaustion.
Applications may initialize a VSAM browse key with LOW-VALUES for a start or HIGH-VALUES for a terminal bound. The exact access statement and key semantics depend on ESDS, KSDS, RRDS, update mode, and site conventions. HIGH-VALUES does not bypass VSAM key validation. A key containing FF must fit the defined key length and be acceptable to the operation. Check FILE-STATUS after POINT, GET, PUT, or WRITE instead of assuming a sentinel guarantees success.
Some upstream programs deliberately initialize unused fields to HIGH-VALUES. An Easytrieve validation job can identify those records before attempting numeric conversion or report formatting. Test the raw alphabetic or binary overlay first, record the key, then decide whether to reject, translate, or preserve the sentinel. Converting FF-filled packed fields directly can cause data exceptions.
1234567IF RAW-AMOUNT HIGH-VALUES ERROR-CODE = 'H01' DISPLAY 'AMOUNT CONTAINS HIGH VALUES' CUSTOMER-ID GOTO JOB END-IF VALID-AMOUNT = INPUT-AMOUNT
Raw FF bytes are not reader-friendly report content. Depending on translation and printer handling, they may appear as unusual symbols, blanks, or control-like output. Translate a sentinel to an explanatory label in a derived field before PRINT. Keep the original bytes unchanged if they are needed for audit.
123456789DEFINE DISPLAY-STATUS W 18 A IF STATUS-BYTES HIGH-VALUES DISPLAY-STATUS = 'HIGH-VALUE MARKER' ELSE DISPLAY-STATUS = 'NORMAL' END-IF PRINT STATUS-RPT
| Constant | Single-byte pattern | Typical meaning |
|---|---|---|
| HIGH-VALUES | X'FF' | Collating-high or special sentinel |
| LOW-VALUES | X'00' | Binary low or cleared byte sentinel |
| SPACE / SPACES | Usually EBCDIC X'40' | Blank character data |
| ZERO / ZEROS | Depends on numeric type | Numeric zero |
Working storage does not default to HIGH-VALUES. Alphabetic fields default to blanks and numeric fields default to zero. If a high sentinel is required, move HIGH-VALUES explicitly before its first use. VALUE with an explicit hexadecimal literal can also establish a byte pattern where supported, but MOVE HIGH-VALUES states the intent more clearly and automatically covers the receiver length.
HIGH-VALUES is a documented reserved word in Broadcom Easytrieve Report Generator 11.6 and older CA-Easytrieve Plus material. The X'FF' definition is stable. What can differ is the external system's interpretation: database keys, sort products, code pages, DBCS formats, and APIs can impose additional rules. Treat the Easytrieve constant semantics as one part of the contract and verify the receiving system separately.
Think of every byte as a row of eight tiny switches. HIGH-VALUES turns all eight switches on in every box. That pattern is often placed after normal letter keys, so it can act like a sign saying “past all ordinary names.” It is not the biggest amount of money. If a money box expects decimal digits, filling it with switches instead of digits makes the money unreadable.
1. What byte does HIGH-VALUES represent in a single-byte field?
2. What does IF KEY-FIELD HIGH-VALUES test?
3. Does MOVE HIGH-VALUES TO AMOUNT mean the largest valid packed amount?
4. A common use for HIGH-VALUES is:
5. How should a program test for the pattern?