MainframeKit

AEIV

LENGERR condition not handledCICS ABEND

A command raised LENGERR (a length value was invalid or too long) and the program did not handle it.

MOST LIKELY

LENGTH points at the wrong field, so CICS picks up a garbage or negative value.

FIRST CHECK

Find the failing command from the abend message and trace or dump; capture RESP2 if you can.

TRY IT ▸

MainframeKit assistant

What it means

CICS found a length it could not accept, the program did not check RESP, so CICS ended the task with AEIV.

On LINK, RESP2 says which length: 11 COMMAREA length below 0 or too big, 12 DATALENGTH negative, 13 DATALENGTH bigger than LENGTH, 26 zero COMMAREA address with a nonzero length, 27 bad INPUTMSG length.

Typical causes

  • LENGTH points at the wrong field, so CICS picks up a garbage or negative value.
  • In Assembler, LENGTH given as an equate value instead of the address of a halfword holding the length.
  • DATALENGTH set larger than LENGTH, or left negative.
  • A COMMAREA pointer is not set but a length is passed.
  • LENGTH is larger than the real data area, so the copy would overlap other storage.

How to fix it

  1. Find the failing command from the abend message and trace or dump; capture RESP2 if you can.
  2. Check that LENGTH and DATALENGTH name fields that hold the right binary values at the time of the call.
  3. Make LENGTH no larger than the data area it describes.
  4. In Assembler, pass the length field, not an equate, or let the translator work it out.
  5. Add RESP and RESP2 so a bad length is reported instead of abending.