Simple Insertion Editing

Insertion editing is a way to format numeric variables for display, particularly in human-readable formats. One of the editing techniques is "simple insertion editing".

Simple insertion editing is inserting a character(s) in the PICTURE string. Its length is counted as the number of characters displayed or printed, which includes editing characters.

Notes -

  • It doesn't affect the PICTURE clause value and only changes how the data is displayed.
  • The insertion characters are inserted at the specified position in the PICTURE when a value is moved into the edited item.

The syntax for simple insertion editing involves the use of editing symbols -

  • , - Inserts comma.
  • B - Inserts one or more blank characters.
  • / - Inserts one or more '/' characters.
  • 0 - Inserts a leading zero if necessary. It is used to ensure that a particular position will always show a numeric value by inserting a leading zero if necessary.
Note! The length of the edited PIC clause may or may not be same as source PIC clause.

Examples -

PICTURE InputOutput
9(7)1234 0001234
99B99B99991017202310 17 2023
Note! B represents space in the above table.