Informix Error -2952: In order to use a picture, the picture length must be the same as the display field length.
Cause and resolution
In order to use a picture, the picture length must be the same as the display field length.
The string that is specified with the PICTURE attribute must have exactly the same length as the field as depicted in the SCREEN section. Review the definition of this field, and make the two lengths agree.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2952 fires when a PICTURE attribute's string doesn't have exactly the same length as its
display field's width in SCREEN — per the official guidance, the PICTURE string's length
and the field's SCREEN length must agree exactly.
- A
PICTUREstring shorter or longer than the field's declared width inSCREEN, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the definition of the field, and make the two lengths agree, per the official guidance.
Examples
A PICTURE string shorter than its field
SCREEN
{
Phone: [phone ]
}
END
ATTRIBUTES
phone = phone_num, PICTURE = "(###)###-####";
-- -2952: PICTURE is 13 characters, but the field is 16
Corrected
SCREEN
{
Phone: [phone ]
}
END
Diagnostic Checks
- Compare the
PICTUREstring's character count to the field's width inSCREEN, and adjust whichever is inconsistent.
Related Errors / Related Topics
- -2933 — "The format width is larger than the allocated display width." The equivalent
length-mismatch rule for
FORMAT, applied here toPICTURE. - -2934 — "The format width is less than the allocated display width." The equivalent
narrower-mismatch rule for
FORMAT, applied here toPICTURE.
A PICTURE string's length doesn't match its field's declared width in SCREEN — adjust one
to match the other.