Forming the Body of an Edit Word for Display Files

The following characters have special meanings when used in the body of an edit word.

Blank for Display Files

A blank is replaced with the character from the corresponding position of the data field. A blank position is referred to as a digit position.

Ampersand for Display Files

An ampersand causes a blank in the edited field. The ampersand is not displayed. Note that ampersands specified in the edit word between blanks can result in incorrect data when specified for an output/input field. This is because embedded blanks in a numeric-only field are converted to zeros.

Zero for Display Files

A zero stops zero suppression. Place it in the farthest right position where zero suppression is to stop. The zero is replaced with the character from the corresponding position of the data field, unless that character is a zero. Any zeros in the data that appear to the right of the stop-zero-suppression character are displayed. The stop-zero-suppression character is considered a digit position; however, when it is the first character, it may not represent the digit position. At least one leading zero is suppressed, unless it is the first character of the EDTWRD. Then it does not count as a digit because the number of blanks equals the number of digits in the field. Each zero that is suppressed is replaced by a blank. An asterisk replaces zeros with asterisks (asterisk protection). Place the asterisk in the farthest right position where zero suppression is to stop. Each zero that is suppressed is replaced by an asterisk.

Note:
If your display file was created before Version 2 Release 1, it is possible that the Edit Word (EDTWRD) keyword will produce different output after a recompile.

Asterisk for Display Files

An asterisk preceding a zero is interpreted as representing asterisk protection, and in this case, the zero prints as a constant. Any asterisks or zeros to the right of the stop-zero-suppression character are constants.

Currency Symbol for Display Files

If you code a currency symbol immediately to the left of the zero suppression code, a currency symbol is inserted in the position to the left of the first significant digit. It is called the floating-currency symbol when used in this manner.

If you code a currency symbol in the farthest left position of the edit word, it is fixed and prints in the same location each time. When used in this manner, it is called the fixed-currency symbol.

The currency symbol is not considered a digit replace position. This symbol must correspond to the system value QCURSYM.

Decimals and Commas for Display Files

Decimals and commas are printed in the same relative positions in which they are coded in the edit word unless they are to the left of the first significant digit. In that case, they are blanked out or replaced by an asterisk.

All other characters are printed if they are to the right of significant digits in the edit word. If they are to the left of the high-order significant digits in the edit word, they are blanked out or replaced by asterisks if asterisk protection is being used.

If a constant is to be printed in the left most position, the constant must be preceded by a zero and the field length increased by one.