Handling of Numeric-Edited and External Floating-Point Items

Numeric-edited and external floating-point items in COBOL are numeric items that are represented as formatted text, which is formed according to the PICTURE clause editing rules. You can select the processing type to apply in a Copybook resource’s Field Configuration page.

Rules

In the XSD Type column of the Field Configuration page, each numeric-edited item contains the value string and a numeric type appropriate for the item’s PICTURE clause. Note these rules:

  • If you select string, the Plug-in processes the item as a string and does not validate its content. The Trim Whitespaces from String Values setting of the Parse Copybook Data activity and the Filler Character setting of the Render Copybook Data activity are in effect.
  • If you select a numeric XSD type, PICTURE clause editing and deediting are in effect. The Plug-in converts the string’s text content to a number during parsing and a number to text during rendering according to the PICTURE clause’s editing rules.

    If the text content of the item do not conform to the PICTURE clause, the Parse Copybook Data activity fails.

  • The Character Set settings are always in effect.
  • The XSD type string is selected by default for numeric-edited items. double is selected by default for external floating-point items.
    Warning: Exercise caution with the string type. Because the Plug-in performs no validation during rendering, you might inadvertently supply malformed data to a COBOL program, which might lead to an abend or data corruption that might be difficult to track.

Validation

If you select a numeric XSD type, the Plug-in validates the field’s text content during parsing. Any deviations from the format in the PICTURE clause lead to activity failures.

For example, the value 123 45, for an item with PICTURE 999.99 fails because of the missing decimal point in the position number 4.

Note: In many cases, COBOL applies no or minimal validation to the text data of numeric-edited items. If you find the strict validation that the Parse Copybook Data activity applies to be undesirable, select the XSD type string or base64Binary in the Field Configuration Page.

The Plug-in also validates the VALUE clause against PICTURE. In case of a mismatch, the Plug-in discards the VALUE clause.