Numeric Items with Scaling Position P
Numeric items can contain the character P in the PICTURE clause. These characters can be present as a continuous sequence at the beginning or end of PICTURE.
When located at the beginning of the clause, the P character indicates a decimal point followed by zeros. For example, PIC PPP9 describes values 0.0001, 0.0002, and so on.
When it is displayed at the end of the clause, the P characters indicate several zeros at the end of a value. A decimal point is presumed at the end of a value. For example, PIC 9PPP describes values 1000, 2000, and so on.
The storage size is unaffected by P, and the zeros are not stored but rather are implicitly added to the actual algebraic value during mathematical operations, MOVE operations, and so on.
The Plug-in adds the zeros as well so that ActiveMatrix BusinessWorks processes see the implied algebraic value. The XSD schema uses a type and constraints that account for the zeros.
Specifically:
- The Parse Copybook activity adds zeros to the output values and returns an algebraic value.
- The Render Copybook Data activity accepts an algebraic value and removes zeros at P positions.
- A BusinessWorks process is free to pass a value that contains non-zero digits at a P position, but the XSD schema does not have enough constraints to validate that. However, if this happens the Render Copybook Data activity throws an exception to avoid loss of data. If truncation is desirable, perform it before passing data to a Render Copybook activity.
- Characters P in COMP-5 items are not supported. They are ignored and such items are treated as regular unscaled COMP-5 items. The VALUE clause for such items is ignored.