Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
← Back to SQLCODE Reference
Error

SQLCODE -311

Varchar length invalid

Explanation

The length in VARCHAR host variable structure is invalid.

Solution

Ensure VARCHAR structure has valid length (positive, within limits).

Example

01 WS-VAR. 05 WS-LEN PIC S9(4) COMP. 05 WS-DATA PIC X(100).