A payroll register, inventory listing, or control-break summary is only readable when numbers look like money, dates look like calendars, and identifiers keep their leading zeros. Easytrieve separates storage from presentation: packed amounts and zoned counters live in file buffers, while the MASK parameter on DEFINE tells the report writer how to paint those values on LINE and TITLE rows. MASK does not alter bytes on disk or in working storage—it runs at display time when PRINT selects a report and the product formats each field for the listing. This page teaches report-oriented mask syntax, every edit character Broadcom documents for Release 11.6, default masks when you omit MASK, money and date column patterns, BWZ for sparse adjustment columns, mask identifier reuse across dozens of amount fields, negative indicators for credits, and how SUMSPACE on REPORT expands total masks. Terminology and examples follow CA Easytrieve Report Generator 11.6 Language Reference MASK Parameter and Getting Started edit-mask material.
Report layout lives in the REPORT subactivity: TITLE for headers, LINE for detail and summary rows, CONTROL for breaks, SUM for explicit totals. When LINE names a field such as GROSS-PAY or QTY-ON-HAND, the report writer looks up that field's DEFINE characteristics. If MASK is present, the product formats the internal numeric value through the edit pattern before placing characters in the output stream. HEADING on DEFINE supplies the column title text; MASK supplies the numeric picture. Beginners sometimes confuse the two—HEADING is the label above the column, MASK is the stencil over the number beneath it.
Broadcom documents MASK on DEFINE and ROW statements. ROW belongs to screen activities; DEFINE in the Library section is where batch report programmers spend most mask effort. Once GROSS-PAY carries MASK '$$,$$9.99', every LINE that lists GROSS-PAY inherits that format until you define a different mask on another statement (ROW allows override on online maps). Arithmetic in JOB INPUT—ADD, IF, MOVE—never passes through the mask. A reader sees $1,234.56 while IF GROSS-PAY GT 1000 still compares the raw quantitative value.
1234567DEFINE GROSS-PAY 94 4 P 2 HEADING 'Gross Pay' MASK '$$,$$9.99' DEFINE HIRE-DATE 136 6 N HEADING 'Hired' MASK 'Z9/99/99' DEFINE EMP-PHONE W 10 N HEADING 'Phone' MASK '(999) 999-9999' REPORT PAYROLL TITLE 'Employee Listing' LINE 01 EMP-NAME EMP-ID HIRE-DATE EMP-PHONE GROSS-PAY
The optional MASK parameter uses this format per Broadcom 11.6 Language Reference:
1[MASK ({[mask-identifier][BWZ]['mask-literal']|HEX })]
| Component | Role on reports |
|---|---|
| mask-identifier (A–Y) | Names a mask for reuse on other DEFINE statements; retrieve with MASK letter alone |
| BWZ | Blank when zero—suppresses entire formatted column cell when field is all zeros |
| 'mask-literal' | Quoted edit pattern; one mask character per field digit plus insertion symbols |
| HEX | Display field in double-digit hexadecimal (up to 50 bytes); not for VARYING fields |
You may combine options—for example MASK M BWZ '$$,$$9.99' registers money format under letter M and suppresses zero-dollar lines. BWZ alone without a literal is also valid. The product allows up to 217 edit masks per program: 192 unidentified and 25 identified (letters A through Y). Do not assign the same identifier to two different literals in one program; later references retrieve the first definition.
Each digit in a numeric field must map to an edit mask character in the quoted literal. Broadcom lists these symbols in the MASK Parameter Editing Rules section:
| Symbol | Meaning | Typical report use |
|---|---|---|
| 9 | Prints a digit (leading zeros appear) | SSN segments, part numbers, fixed-width counts |
| Z | Prints a digit except leading zeros | Amounts and quantities without leading zero clutter |
| * | Prints asterisks instead of leading zeros | Check-style protected amounts on payment registers |
| - | Minus sign before first nonzero digit of a negative number | Floating negative sign in financial columns |
| $ | Currency symbol before first nonzero digit (symbol from MONEY site option) | Dollar or shop currency on wage and balance columns |
| x (lowercase) | Insertion symbol—prints any character with edited data | Literal text such as SSN prefix embedded in mask (see examples below) |
Commas and periods serve as insertion symbols as well as decimal and grouping punctuation. There is no implied link between decimal positions on DEFINE (for example P 2) and decimal point placement in the mask—you must code the correct number of digit positions and the decimal point explicitly in the literal. A field defined P 7 2 still needs two fractional nines or Zs after the period in the mask or the printed report will not match business expectations.
Z, $, -, and * behave as digit-printing symbols only when they are the first symbol of the edit mask and only through the first nine symbol positions. Symbols before the last digit position—including Z, $, -, *, comma, and period—can act as insertion characters. Insertion symbols before the first digit position always print. When the digit following an insertion symbol is 9, insertion characters always print. When the following digit position is Z, $, -, or *, insertion symbols print only if that digit position prints; otherwise insertion symbols become fill characters. In mask 'ZZZ,999.99' the comma always prints; in 'ZZZ,Z99,99' the comma prints only if the digit before it is nonzero. These rules explain why two similar money masks can format sub-thousand amounts differently on the same report.
The default fill character is blank unless the mask uses asterisk as a leading-zero replacement. When the first symbol of an edit mask is a dash or a currency symbol, the display length is the mask length plus one per Broadcom documentation—budget extra column width on LINE when the first printed character is floating. SUM fields on control reports automatically widen: the mask for a SUM field increases by the number of digits specified by SUMSPACE on the REPORT statement, duplicating the first digit position as needed so large totals do not overflow the column.
When DEFINE omits MASK, quantitative fields receive system default edit masks based on decimal count. Broadcom 11.6 publishes this table—your site may add masks through the Site Options Table at install time:
| Decimals on DEFINE | Default mask pattern |
|---|---|
| none (non-zoned) | ZZZZZZZZZZZZZZZZZZ (18 Z positions) |
| 0 | ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ- |
| 1 | ZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.9- |
| 2 | Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.99- |
| 3 | ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.999- |
| zoned, 0 decimals | 999999999999999999 (all nines) |
Defaults include trailing minus for negative indicators. Override defaults when policy requires credit words, floating dollar signs in different columns, or BWZ on optional adjustment fields. A shop that prints the same REPORT on green-bar paper and on PDF may still share one DEFINE mask—the override is at field definition time, not per PRINT statement.
Broadcom Getting Started and MASK Parameter sections document these display results. Internal storage is quantitative; printed columns follow the mask:
| Mask literal | Field contents | Displayed on LINE |
|---|---|---|
| '$$,$$9' | 01234 | $1,234 |
| '$$,$$9' | 00008 | $8 |
| '$$,$$9.99' | 0123456 | $1,234.56 |
| 'ZZZ,ZZ9' | 000123 | 123 |
| '---,--9' | -001234 | -1,234 |
| 'Z,ZZZ,ZZZ.99' | .01 | .01 |
Protected check amounts use asterisk replacement masks documented as **9, **,**9, and **,**9.99—leading zeros become asterisks so tampering is visible on payment listings. Pair these with adequate LINE spacing so widened columns do not collide with adjacent NAME or DATE fields.
123DEFINE CHECK-AMT W 5 P 2 HEADING 'Check Amt' MASK '**,**9.99' DEFINE NET-PAY W 5 P 2 HEADING 'Net Pay' MASK M '$$,$$$,$$9.99' DEFINE BONUS W 4 P 2 HEADING 'Bonus' MASK M BWZ
Dates stored as numeric MMDDYY or similar layouts use masks with slashes as insertion symbols. Leading-zero-sensitive identifiers require 9 rather than Z so the report preserves zeros the business treats as significant:
| Mask | Contents | Report display |
|---|---|---|
| 999-99-9999 | 053707163 | 053-70-7163 |
| (99)-9999 | 006421 | (00)-6421 |
| Z9/99/99 | (date value) | Date with slashes, leading zero suppressed on first digit |
| 'SSN 999-99-9999' | 123456789 | SSN 123-45-6789 |
Literal text inside the mask—SSN prefix, labels such as MINUS—uses insertion rules. Mask 'ZZHELLOZZ9.99' with value 1234.01 prints 1HELLO234.01 on the report line, demonstrating how fixed text and digits interleave. Use such patterns sparingly on dense LINE layouts because total print width includes every insertion character.
Symbols after the last digit position specify the negative indicator. They print when the edited value is negative and become fill characters when positive. Typical shop standards use trailing minus, CR for credit, or spelled-out MINUS:
| Mask | Negative input | Positive input |
|---|---|---|
| ZZZ- | 123- | 123 |
| ZZZ CR | 123 CR | 123 |
| ZZZ.99 MINUS | 12.45 MINUS | 12.45 |
| '---.99' | -123.45 | 123.45 |
Control-break total lines inherit the same masks as detail fields unless SUM or report options alter formatting. Verify sign presentation on both detail LINE and break summary LINE during test runs—an inconsistent CR on totals but not detail confuses auditors.
Adjustment, bonus, and exception columns often contain zeros for most employees. BWZ (blank when zero) suppresses the entire formatted field when every digit is zero, leaving a blank cell instead of 0.00 or $0.00. Stored value remains zero for IF logic; only the printed LINE changes. Combine BWZ with a money literal on DEFINE for optional columns on wide registers. BWZ is not carried forward when you reuse a mask identifier alone—you must code BWZ on each field that needs suppression.
Large payroll and GL reports repeat the same money picture on twenty or more amount fields. Define MASK M '$$,$$$,$$9.99' on the first amount, then MASK M on subsequent DEFINE statements to retrieve the pattern. Identifiers A through Y also retrieve masks preloaded in the Site Options Table at your installation. Consistent identifiers prevent one column from using Z suppression while another prints leading zeros on the same TITLE/LINE layout. Never register two different literals under the same letter in one program.
MASK HEX displays internal bytes as double-digit hexadecimal. Useful on test reports when packed or binary fields misalign—DEBUG-FLD on a LINE shows nybbles readers cannot interpret from decimal masks. HEX is allowed where standard numeric masks are not valid on alphanumeric types. HEX edit masks are not allowed on VARYING fields per Broadcom. Remove HEX columns before production distribution; they belong in developer listings, not customer-facing registers.
Several mechanisms shape report appearance; masks are only one:
Alphanumeric NAME and ADDRESS fields print as stored without numeric editing. Do not code MASK '999' on type A fields expecting alignment—Broadcom states alphanumeric fields cannot be edited except with HEX.
Imagine each number on your report is a cookie cut from dough, and the MASK is the shaped cutter you press on top before showing it on the plate. The cookie itself does not change size in the box—only the outline you show to people gets stars, dollar signs, or slashes. If the cookie is all zeros, BWZ means you leave the plate empty instead of showing a zero-shaped crumb. Letters A through Y are sticky notes on the cutter so every pay column uses the same dollar-sign shape without rewriting the recipe.
1. When a numeric field appears on a LINE statement, formatting usually comes from:
2. Character 9 in a report edit mask means:
3. BWZ on a report amount field:
4. Alphanumeric name fields on a report LINE:
5. Negative indicators such as CR or trailing minus in a mask: