Dictionary/3000 Reference Manual (32244-90001)

Chapter 3 59
Using the DICTDBM Commands
Using Edit Masks
Using Edit Masks
You can define the output format for data elements in reports generated by HP
Inform/3000, Report/3000, and Transact/3000. You do this by defining an edit mask for a
data element to be formatted in a report.
An edit mask is a string of characters describing how the data element should look when it
appears in a report. Characters such as dollar signs and decimal points can be inserted,
and leading zeros suppressed before the data element is displayed in reports. You can
define edit masks with either the CREATE or MODIFY commands.
Edit masks can be defined with up to 30 characters. All characters except the following,
are treated as insert characters:
^ means that the next character in the source field is to be inserted into the
display field.
Z means that leading zeros are to be suppressed.
$ means that leading zeros are to be suppressed and that the left-most zero
is to be replaced with a dollar sign.
* means that asterisks are to replace leading zeros.
. means that the implied decimal point defined for the element is to be
aligned in the position where this one appears.
! means that a decimal point for a data element is to appear in the position
specified by “!” ; use of the "!" character overrides an implied decimal point
for the data element.
If the last character of the edit string is a negative sign, a negative data element is
displayed with a trailing minus sign (-). If the last characters of the edit string are CR (for
CREDIT) or DR (for DEBIT), the data element is displayed with a trailing CR or DR,
respectively. Table 3-2 shows how edit masks affect the displayed value for different data
elements.
Table 3-2. Using Edit Masks with Elements
Data Element Value EDIT MASK Displayed Value
1234
$$,$$$.^^
$12.34
123456
$$,$$$.^^
$1,234.56
123456
***,**$.^^
*$1,234.56
000009
ZZZZ.^^
.09
-123456
$$,$$$.^^CR
$1,234.56CR
810807
^^/^^/^^
81/08/07
-123
$$,$$$.^^-
$1.23=
1234
ZZZZ!
1234.