Informix Error -2972: This column cannot be right justified or zero-filled because its displayed width does not match the actual column width.
Cause and resolution
This column cannot be right justified or zero-filled because its displayed width does not match the actual column width.
In order to use the RIGHT or ZEROFILL attributes, make sure that the field size (as depicted in the SCREEN section) is exactly the same as the width of the database column. Review this statement, the screen layout, and the definition of the table in the database to make sure these sizes agree.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2972 fires when the RIGHT or ZEROFILL attributes are used on a field whose displayed
width (in SCREEN) doesn't match its database column's actual width — per the official
guidance, using either attribute requires the field size and the column width to agree exactly.
- A field's
SCREENwidth differing from its database column's actual width, combined withRIGHTorZEROFILL, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the statement, the screen layout, and the table definition in the database, per the official guidance, to make the field size and column width agree.
Examples
RIGHT on a mismatched-width field
SCREEN
{
Code: [code ]
}
END
ATTRIBUTES
code = item_code, RIGHT;
-- -2972: item_code is CHAR(10), but the display field is only 8 wide
Corrected
SCREEN
{
Code: [code ]
}
END
Diagnostic Checks
- Check the
SCREENwidth of any field usingRIGHTorZEROFILLagainst its database column's actual width, and make them agree.
Related Errors / Related Topics
- -2952 — "In order to use a picture, the picture length must be the same as the display
field length." The same size-agreement principle applied to
PICTURE, rather thanRIGHT/ZEROFILL.
RIGHT/ZEROFILL is used on a field whose SCREEN width doesn't match its database column's
actual width — make the sizes agree.