Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Floating insertion editing

This type of editing is valid only for numeric-edited items.

The following symbols are used:

cs + -

Within one PICTURE character-string, these symbols are mutually exclusive as floating insertion characters.

Floating insertion editing is specified by using a string of at least two of the allowable floating insertion symbols to represent leftmost character positions into which the actual characters can be inserted.

The leftmost floating insertion symbol in the character-string represents the leftmost limit at which the actual character can appear in the data item. The rightmost floating insertion symbol represents the rightmost limit at which the actual character can appear.

The second leftmost floating insertion symbol in the character-string represents the leftmost limit at which numeric data can appear within the data item. Nonzero numeric data can replace all characters at or to the right of this limit.

Any simple-insertion symbols (B 0 / ,) within or to the immediate right of the string of floating insertion symbols are considered part of the floating character-string. If the period (.) special-insertion symbol is included within the floating string, it is considered to be part of the character-string.

To avoid truncation, the minimum size of the PICTURE character-string must be:

Representing floating insertion editing

In a PICTURE character-string, there are two ways to represent floating insertion editing and thus two ways in which editing is performed:

  1. Any or all leading numeric character positions to the left of the decimal point are represented by the floating insertion symbol. When editing is performed, a single floating insertion character is placed to the immediate left of the first nonzero digit in the data, or of the decimal point, whichever is farther to the left. The character positions to the left of the inserted character are filled with spaces.

    If all numeric character positions in the PICTURE character-string are represented by the insertion character, then at least one of the insertion characters must be to the left of the decimal point.

  2. All the numeric character positions are represented by the floating insertion symbol. When editing is performed, then:

For example:

PICTURE Value of data Edited result

       $$$$.99      

           .123      

          $.12       

       $$$9.99      

           .12       

         $0.12       

  $,$$$,999.99      

      -1234.56       

     $1,234.56       

  +,+++,999.99      

    -123456.789      

   -123,456.78       

 $$,$$$,$$$.99CR    

   -1234567          

 $1,234,567.00CR     

 ++,+++,+++.+++     

        0000.00      

                     

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)