Guardian Procedure Calls Reference Manual (G06.25+)
Formatter Edit Descriptors
Guardian Procedure Calls Reference Manual—522629-013
F-19
The M Edit Descriptor
The M Edit Descriptor
The mask formatting edit descriptor edits either alphanumeric or numeric data
according to an editing pattern or mask. Special characters within the mask indicate
where digits in the data are to be displayed; other characters are duplicated in the
output field as they appear in the mask. The M edit descriptor has the form:
M'
mask'
mask a character string; mask can be enclosed in apostrophes ('), quotation
marks ("), or less-than and greater-than symbols (<>). The string supplied
must not exceed 255 characters.
The M edit descriptor is not allowed for input.
Characters in a mask that have special functions are:
Z Digit selector
9 Digit selector
V Decimal alignment character
. Decimal alignment character
The field width
w is determined by the number of characters, including spaces but
excluding Vs, between the mask delimiters. The field processed is
w characters
starting at the current position. After the field is processed, the current position is
advanced by
w characters. Except for the decimal point alignment character, V, each
character in the mask either defines a character position in the field or is directly
inserted in the field.
The M edit descriptor causes numeric data elements to be rounded to the number of
positions specified by the mask. String data elements are processed directly. Each
digit or character of a data element is transferred to the result field in the next available
character position that corresponds to a digit selector in the mask. If the digit selector
is a 9, it causes the corresponding data digit to be transferred to the output field. The
digit selector Z causes a nonzero, or embedded zero, digit to be transferred to the field,
but inserts blanks in place of leading or trailing zeros. Character positions must be
allocated, by Z digit selectors, within the mask to provide for the inclusion of any minus
signs or decoration character strings. A decimal point in the mask can be used for
decimal point alignment of the external field. The letter V can also be used for this
purpose. If a V is present in the mask, the decimal point is located at the V, and the
position occupied by the V is deleted. If no V is present, the decimal point is located at
the rightmost occurrence of the decimal point character (usually .). If neither a V nor a
decimal point character is present, the decimal point is assumed to be to the right of
the rightmost character of the entire mask.
Although leading and trailing text in a mask is always transferred to the result field, text
embedded between digit selectors is transferred only if the corresponding digits to the
right and left are transferred.