Output Masks

Output masks are employed to format the output of fields, form fields, and data values in output operations.

The MASK format option in Zim Reports specifies an output mask pattern for a report item.

The $mask function specifies an output masking pattern to be applied to fields, form fields, and data values and returns a character string with the result of the masking operation.

The Field Mask attribute defines the expected output format of a field's data value when it is printed or listed in Zim Reports, or by the list or output commands.


Mask patterns used with any of the three options described above are constructed in the same manner using the same set of available characters.

However, the set of characters available varies according to the data type of the item being masked. For more information on mask patterns and their relation to data types, see Masking.

Selected Examples of Mask Patterns for Numbers

In the following examples, leading or trailing spaces are indicated by / in the Output column.

Output of Sign Placeholders

Sign Placeholder Output When Masked Value <0 Output When masked Value >=0
'-' - /
'+' - +
'CR' CR //
'DB' DB //
')' ) /
'(' ( /

Behaviour of Fixed Text Characters

Output Mask Pattern Item Value Output
'ZZ/ZZZZ' 1234 ///1234
'ZZ/ZZZZ' 12345 /1/2345
'Z9/ZZZZ' 1234 /0/1234
'***,***' 999 ****999

Behaviour of Float Characters

Output Mask Pattern Item Value Output
'$$$,$$9.99CR' 1324.77 /$1,324.77//
'$$$,$$9.99CR' -56.88 ////$56.88CR
'$$,$$9.99DB' -2566.44 $2,566.44DB
'$$,$$9.99DB' .00 /////$.00//
'$,$$9.99+' 1324.77 1,324.77+
'$$$9.99+' -56.88 /$56.88-
'(((9,999,99)' -1324.82 //(1,324.82)
'((ZZ,999.99)' -386.41 //( 386.41)
'$.$$' 0.00 ////
'($$,$$9.99)' -56.88 ///($56.88)
'($$,$$9.99)' -5.2 ////($5.20)
'+$$,$$$.99' -56.88 ///-$56.88
'+$$,$$$.99' 2562.55 +$2,562.55

Mask Patterns and the Language Customizer

Certain characters inserted into the output value by a mask are defined internally in the software.

The Language Customizer (ZIMLANG) administrative utility is used to redefine the internal characters and strings used by the software in a variety of circumstances, such as output masks.


For example, the currency placeholder $,  is by default the dollar sign $. However, it can be redefined to output other symbols, such as the Euro sign , the pound sign  £, etc.

To achieve this, the Language Customizer can redefine the currency symbol output by the currency placeholder.


When using the Language Customizer to edit the software's internal characters and strings, note the following:

For example, in Zim application programs, the dollar sign $ is universally used as the currency placeholder.

However, the currency symbol output by the placeholder depends on the current language customization (if any).