Easytrieve Report Masks

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.

Progress0 of 0 lessons

How Masks Connect to Report Output

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.

text
1
2
3
4
5
6
7
DEFINE 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

MASK Parameter Syntax on DEFINE

The optional MASK parameter uses this format per Broadcom 11.6 Language Reference:

text
1
[MASK ({[mask-identifier][BWZ]['mask-literal']|HEX })]
MASK parameter components
ComponentRole on reports
mask-identifier (A–Y)Names a mask for reuse on other DEFINE statements; retrieve with MASK letter alone
BWZBlank 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
HEXDisplay 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.

Edit Mask Characters (Verified for 11.6)

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:

Core edit mask symbols
SymbolMeaningTypical report use
9Prints a digit (leading zeros appear)SSN segments, part numbers, fixed-width counts
ZPrints a digit except leading zerosAmounts and quantities without leading zero clutter
*Prints asterisks instead of leading zerosCheck-style protected amounts on payment registers
-Minus sign before first nonzero digit of a negative numberFloating 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 dataLiteral 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.

Insertion Symbol Rules

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.

Fill Characters and Display Width

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.

System Default Masks on Reports

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:

Default masks when MASK omitted (numeric fields)
Decimals on DEFINEDefault mask pattern
none (non-zoned)ZZZZZZZZZZZZZZZZZZ (18 Z positions)
0ZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ-
1ZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.9-
2Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.99-
3ZZZ,ZZZ,ZZZ,ZZZ,ZZZ.999-
zoned, 0 decimals999999999999999999 (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.

Numeric and Money Column Examples

Broadcom Getting Started and MASK Parameter sections document these display results. Internal storage is quantitative; printed columns follow the mask:

Money and quantity masks on reports
Mask literalField contentsDisplayed on LINE
'$$,$$9'01234$1,234
'$$,$$9'00008$8
'$$,$$9.99'0123456$1,234.56
'ZZZ,ZZ9'000123123
'---,--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.

text
1
2
3
DEFINE 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

Date and Identifier Columns

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:

Date and ID masks (from Broadcom examples)
MaskContentsReport display
999-99-9999053707163053-70-7163
(99)-9999006421(00)-6421
Z9/99/99(date value)Date with slashes, leading zero suppressed on first digit
'SSN 999-99-9999'123456789SSN 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.

Negative Indicators on Financial Reports

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:

Negative indicator masks
MaskNegative inputPositive input
ZZZ-123-123
ZZZ CR123 CR123
ZZZ.99 MINUS12.45 MINUS12.45
'---.99'-123.45123.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.

BWZ and Sparse Report Columns

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.

Mask Identifiers for Consistent Reports

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 for Diagnostic Report Columns

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.

MASK Versus Other Report Formatting

Several mechanisms shape report appearance; masks are only one:

  • HEADING on DEFINE sets column title text on TITLE rows—not numeric format.
  • MASK formats numeric field values on LINE and TITLE when the field name appears.
  • Literal strings on LINE print exactly as coded; they do not pass through field masks.
  • COL and POS on LINE control horizontal placement; they do not replace MASK width planning.
  • SUMSPACE on REPORT widens SUM total masks; it does not change detail field DEFINE masks.

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.

Common Report Mask Mistakes

  1. Too few digit positions in the literal for field length and decimals—truncated amounts on LINE.
  2. Assuming DEFINE decimal count automatically inserts the decimal point in the mask.
  3. Numeric mask on alphanumeric TYPE A field—unsupported for standard editing.
  4. Reusing mask identifier M for two different literals in one program.
  5. Ignoring display width expansion when mask starts with $ or -—columns overlap neighbors.
  6. Expecting MASK to round or change values used in JOB arithmetic—it is display-only.
  7. HEX on VARYING field—disallowed by documentation.
  8. Forgetting BWZ on optional columns—reports fill with zero dollars readers misread as missing data.

Testing Masks Before Production

  1. Print boundary values: zero, small positive, large comma-grouped amounts, negative with CR or minus.
  2. Verify leading-zero IDs (SSN, part number) with 9 masks versus suppressed Z masks.
  3. Check control-break total LINE uses widened mask when SUMSPACE is coded on REPORT.
  4. Confirm BWZ columns blank on zero rows but IF logic still sees zero internally.
  5. Measure total LINE width with floating currency and negative indicators so LINESIZE is not exceeded.

Explain It Like I'm Five

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.

Exercises

  1. Define GROSS-PAY with HEADING and MASK for dollars and cents; add the field to LINE 01.
  2. Write a phone mask on a ten-digit N field and predict display for contents 2125551234.
  3. Register a money mask under letter P and reuse MASK P on two other amount fields.
  4. Add BWZ to a bonus field and explain what prints when BONUS is zero versus 100.00.
  5. Compare default mask for P 5 2 with explicit MASK '$$,$$9.99' on test output.
  6. Design a negative-amount mask with trailing CR and list one positive and one negative expected LINE.
  7. Explain why MASK does not change the result of IF GROSS-PAY GT 0 in JOB logic.

Quiz

Test Your Knowledge

1. When a numeric field appears on a LINE statement, formatting usually comes from:

  • MASK on the field DEFINE (or system default if omitted)
  • The LINE statement alone with no field definition
  • JCL DD statement
  • SORT control cards

2. Character 9 in a report edit mask means:

  • Print one digit from the field
  • Always print the literal digit nine
  • Skip nine columns
  • Nine decimal places

3. BWZ on a report amount field:

  • Suppresses display when the field is all zeros
  • Converts the field to binary
  • Blocks page breaks
  • Bolds the column heading

4. Alphanumeric name fields on a report LINE:

  • Cannot use standard numeric edit masks (except MASK HEX)
  • Require MASK 999 for alignment
  • Must use BWZ
  • Auto-format as currency

5. Negative indicators such as CR or trailing minus in a mask:

  • Print after the last digit only when the value is negative
  • Print on every line regardless of sign
  • Replace HEADING text
  • Apply only to TITLE literals
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 MASK Parameter, DEFINE, Editing RulesSources: Broadcom Easytrieve 11.6 MASK Parameter, Getting Started describe files and fields, ROW statementApplies to: Easytrieve report masks on DEFINE for LINE and TITLE output