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
- 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.
- Use SET instead of INTO, or give LENGTH explicitly for variable-length records.
- Keep DATALENGTH no larger than LENGTH on LINK and use a length greater than zero on START.
- Check the queue definition's record size or control interval against the length written to a transient data queue.