Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

+304

Value does not fit the host variablePOSITIVE SQLCODE (WARNING) · CHECKED 2026-11-14
Checked against IBM documentation

A FETCH or SELECT could not return a value because the host variable is too small. Processing continues with a null indicator.

QUICK ANSWER

A FETCH or SELECT could not return a value because the host variable is too small. Processing continues with a null indicator.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. The host variable data type is too small for the value retrieved.
  2. The host variable does not match the current table definition.

CHECKED 14 Nov 2026 IBM: Db2 13 for z/OS: SQLCODE +304 (Db2 for z/OS 13.0.0)

MOST LIKELY

The host variable data type is too small for the value retrieved.

FIRST CHECK

Verify that table definitions are current.

TRY IT ▸

Site search

What it means

The host variable's data type is not large enough for the retrieved value. The indicator variable is set to -2 and processing continues. SQLSTATE is 01515.

Typical causes

  • The host variable data type is too small for the value retrieved.
  • The host variable does not match the current table definition.

How to fix it

  1. Verify that table definitions are current.
  2. Verify that the host variable has the proper data type.
  3. See SQLCODE -405 for ranges of SQL data types.