TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

COBOL - Fixed Insertion Editing


This type of editing is valid only for numeric-edited items. The following insertion symbols are used:

  • cs
  • + - CR DB (editing-sign control symbols)

In fixed insertion editing, only one currency symbol and one editing-sign control symbol can be specified in a PICTURE character-string.

Unless it is preceded by a + or - symbol, the currency symbol must be the first character in the character-string.

When either + or - is used as a symbol, it must be the first or last character in the character-string.

When CR or DB is used as a symbol, it must occupy the rightmost two character positions in the character-string. If these two character positions contain the symbols CR or DB, the uppercase letters are the insertion characters.

Editing sign control symbols produce results that depend on the value of the data item, as shown below:

Editing symbol in PICTURE character-stringResult: data item positive or zeroResult: data item negative
++-
-space-
CR2 spacesCR
DB2 spacesDB

For example:

PICTUREValue of dataEdited result
999.99++6555.556555.55+
+9999.99-6555.555 -6555.55
9999.99+1234.561234.56
$999.99-123.45$123.45
-$999.99-123.456-$123.45
-$999.99+123.456$123.45
$9999.99CR+123.45$0123.45
$9999.99CR-123.45$0123.45CR


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal