COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-66
PICTURE Clause
°
Floating insertion
The currency sign and editing sign control symbols plus (+) and minus (-) are
floating insertion characters, mutually exclusive in a PICTURE character-string.
At least two of any one symbol must be used. Simple insertion characters can
be mixed with floating characters.
To indicate floating insertion editing in a PICTURE character-string, you include
a string of at least two of the floating insertion characters. This string can also
contain any of the simple insertion symbols or have simple insertion characters
immediately to its right. Any such simple insertion characters are part of the
floating string.
The leftmost character of the floating insertion string marks the leftmost limit of
the floating symbol. The rightmost character of the floating string marks the
rightmost limit of the floating symbols. The second floating character from the
left marks the leftmost limit of numeric data that can be stored. Nonzero
numeric data can replace all characters at or to the right of this limit.
In floating insertion editing, you can either represent any or all of the leading
numeric positions on the left of the decimal point by the insertion symbol.R or
represent all the numeric positions, right or left of the decimal point, by the
insertion symbol.
If the character-string contains a decimal point symbol, at least one floating
insertion character must appear to the left of it.
If the insertion characters are only to the left of the decimal point, then
assignment to the item places a single floating insertion character in the
position immediately preceding either the decimal point or the first nonzero
digit in the data represented by the insertion symbol string, whichever is farther
to the left in the PICTURE character-string. The character positions preceding
the insertion character are replaced with spaces.
If all numeric character positions in the PICTURE character-string are
represented by the insertion character, the result depends on the value of the
assigned data. If the value is 0, the entire data item is set to spaces. If the
value is not 0, the result is the same as when the insertion character is only to
the left of the decimal point.
To avoid truncation of the edited item, the minimum size of the PICTURE
character-string for the receiving data item must be the number of characters in
the sending item, plus the number of nonfloating characters being edited into
the receiving data item, plus one for the floating insertion character.