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

LENGERR

LENGERRCICS RESP CONDITION · CHECKED 2026-11-14
Checked against IBM documentation

CICS raised LENGERR because a length supplied or required by the command was wrong, or stored data was longer than the area provided.

QUICK ANSWER

CICS raised LENGERR because a length supplied or required by the command was wrong, or stored data was longer than the area provided.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. READ or READQ TS with INTO where the stored record is longer than the LENGTH value, so the data is truncated.
  2. READ of a variable-length file without LENGTH or SET, or an incorrect length for a file with fixed-length records.
  3. LINK with a COMMAREA length below 0 or above the permitted length, or with DATALENGTH negative or greater than LENGTH.
  4. START with LENGTH not greater than zero.
  5. WRITEQ TD with a length not consistent with the queue's record size or control interval.

CHECKED 14 Nov 2026 IBM: READ | CICS Transaction Server for z/OS 6.x · READQ TS | CICS Transaction Server for z/OS 6.x · LINK | CICS Transaction Server for z/OS 6.x · START | CICS Transaction Server for z/OS 6.x · WRITEQ TD | CICS Transaction Server for z/OS 6.x · EXEC interface block (EIB) fields | CICS Transaction Server for z/OS 6.x

MOST LIKELY

READ or READQ TS with INTO where the stored record is longer than the LENGTH value, so the data is truncated.

FIRST CHECK

Make the LENGTH data area at least as large as the longest record you expect; on a READ it is set to the actual record length.

TRY IT ▸

Site search

What it means

LENGERR (EIBRESP 22) means a length did not fit the data or the rules of the command. Typically data longer than the LENGTH area is truncated and LENGERR is raised. The default action is to end the task abnormally.

Typical causes

  • READ or READQ TS with INTO where the stored record is longer than the LENGTH value, so the data is truncated.
  • READ of a variable-length file without LENGTH or SET, or an incorrect length for a file with fixed-length records.
  • LINK with a COMMAREA length below 0 or above the permitted length, or with DATALENGTH negative or greater than LENGTH.
  • START with LENGTH not greater than zero.
  • WRITEQ TD with a length not consistent with the queue's record size or control interval.

How to fix it

  1. Make the LENGTH data area at least as large as the longest record you expect; on a READ it is set to the actual record length.
  2. Use SET instead of INTO, or give LENGTH explicitly for variable-length records.
  3. Keep DATALENGTH no larger than LENGTH on LINK and use a length greater than zero on START.
  4. Check the queue definition's record size or control interval against the length written to a transient data queue.