Edited-Phone-Number PIC 9(3)B9(3)B9(4). … MOVE 5185551212 TO Edited-Phone-Number. DISPLAY Edited-Phone-Number.

01 Edited-Phone-Number PIC 9(3)B9(3)B9(4). … MOVE 5185551212 TO Edited-Phone-Number. DISPLAY Edited-Phone-Number.

The displayed value will be 518 555 1212.

B This symbol inserts a SPACE character into the edited value. The inserted SPACE character will occupy a byte of storage in the edited result.

An example:

01 Edited-Phone-Number PIC 9(3)B9(3)B9(4). … MOVE 5185551212 TO Edited-Phone-Number. DISPLAY Edited-Phone-Number.

The displayed value will be 518 555 1212. CR

This symbol must be used only at the very end of a PICTURE . If “CR“ is used, none of “-”, “+” or “DB” may

be used. It is used to edit numeric values. Multiple “CR“ symbols are not allowed in one PICTURE clause.

A “CR“ symbol will count as two character positions in the size of the data item. If the value moved into the field is negative, the characters “CR” will be inserted into the edited value,

otherwise two SPACES will be inserted. Some examples (the symbol b denotes a space):

This value…

…is moved to a field with

…resulting in this value in

this PICTURE…

17CR DB This symbol must be used only at the very end of a PICTURE. If “DB“ is used, none of “-”, “+” or “CR” may

99CR

be used. It is used to edit numeric values. Multiple “DB“ symbols are not allowed in one PICTURE clause.

A “DB“ symbol will count as two character positions in the size of the data item. If the value moved into the field is negative, the characters “DB” will be inserted into the edited value,

otherwise two SPACES will be inserted. Some examples (the symbol b denotes a space):

This value…

…is moved to a field with

…resulting in this value in

Editing

Meaning and Usage

Symbol

this PICTURE…

Z This symbol must be only be used at the very beginning of a PICTURE except that a “+” or “-“ may appear to the left of it. It is used to edit numeric values.

Multiple consecutive “Z“ symbols are not only allowed, but are the typical manner in which this editing symbol is used. This is called a floating zero suppression.

Each “Z“ symbol will count as one character position in the size of the data item. Think of the editing process as if it worked like this:

1. Determine what the edited value would be if each “Z“ were actually a “9”. 2. Locate the digit in the edited result that corresponds to the right-most “Z“ and scan the edited value back to the left

from that point until you come to a “0” that has nothing but “0” characters to the left of it.

3. Replace that “0” with a SPACE. 4. Replace all remaining “0” characters to the left of that position by SPACES.

Some examples (the symbol b denotes a space):

This value…

…is moved to a field with

…resulting in this value in

this PICTURE…

bbbb265 No more than one editing symbol may be used in a floating manner in the same PICTURE clause.

ZZZZZ99

5. Numeric data items containing editing symbols are referred to as numeric edited fields. Such data items may

receive values in the various arithmetic statements but may not be used as sources of data in those same statements. The statements in question are ADD (section 6.5 ), COMPUTE(section 6.11 ), DIVIDE(section 6.15 ),