Page 1 of 1

ITEMERR in TSQ Read

PostPosted: Fri Jan 27, 2023 8:47 pm
by Mainframe_Dev
Hi,

I am getting ITEMERR when my CICS module reads TS Queue.

EXEC CICS READQ TS
QUEUE (QUEUE NAME)
INTO (WORKING VARIABLE)
LENGTH (TSQ-LENGTH)
RESP (RESP-CD)
RESP2 (ESP2-CD)
END-EXEC

EIBRESP throws 26, which is ITEMERR, As per my search ITEMERR occurs in any of the following situations:

The item number specified is invalid (that is, outside the range of item numbers written to the queue).
An attempt is made to read beyond the end of the queue using the NEXT (default) option.

The item number specified in a WRITEQ TS command with the REWRITE option, is not valid (that is, it is outside the range of entry numbers assigned for the queue).
The maximum number of items (32 767) is exceeded.

Mine is READQ, and i didn't use any NEXT to read beyond end of the queue. Can you guide me what else would have caused the trouble?

Re: ITEMERR in TSQ Read

PostPosted: Sat Jan 28, 2023 5:12 am
by dneufarth
Don’t you need to specify ITEM?

Re: ITEMERR in TSQ Read

PostPosted: Sat Jan 28, 2023 9:13 am
by Mainframe_Dev
I don't think so. I didn't see anything which defined the item.

Re: ITEMERR in TSQ Read

PostPosted: Sat Jan 28, 2023 9:38 am
by dneufarth

Re: ITEMERR in TSQ Read

PostPosted: Sat Jan 28, 2023 10:22 pm
by Mainframe_Dev
Those are options, not mandatory to use. My logic didn't use those options. That's what surprising why it throws ITEMERR even no item /net were used.

Re: ITEMERR in TSQ Read

PostPosted: Sun Jan 29, 2023 4:29 am
by Robert Sample
If you read the syntax diagram in https://www.ibm.com/docs/en/cics-ts/5.5 ... y-readq-ts you will see that you can specify NEXT or you can specify ITEM(data value). The syntax diagram is written such that you MUST specify one of them. If you don't specify either one, the ITEMERR makes sense -- you haven't done anything to specify from where to do a NEXT, and you haven't specified an ITEM number.

Re: ITEMERR in TSQ Read

PostPosted: Mon Jan 30, 2023 1:06 am
by Mainframe_Dev
Thanks Rob, This is the logic implemented long back and working well since then (Late 90's). All of a sudden throwing ITEMERR, which is what surprising me. Let me check. Thanks.