Skip to main content

Module edited_pic

Module edited_pic 

Source
Expand description

Edited PIC (numeric editing) decode and encode support. Edited PIC (Phase E2 + E3) decode and encode support

This module implements decode and encode for edited numeric PICTURE clauses following IBM COBOL specifications. Edited PICs include formatting symbols like Z (zero suppression), $ (currency), comma, decimal point, B (blank space insertion), and sign editing (+, -, CR, DB).

The decode algorithm walks the input string and PIC pattern in lockstep, extracting numeric digits and validating formatting symbols. The encode algorithm formats numeric values according to the pattern.

Structs§

NumericValue
Decoded numeric value extracted from an edited PIC field.

Enums§

PicToken
Pattern tokens for edited PIC clauses.
Sign
Sign extracted from an edited PIC field during decode.

Functions§

decode_edited_numeric
Decode edited numeric string according to PICTURE pattern
encode_edited_numeric
Encode a numeric value to an edited PIC string
tokenize_edited_pic
Tokenize an edited PIC pattern into tokens