The above code does read operation in a sequential manner (trying to read line by line in ESDS) until it finds end of CICS file. But am getting EISRESP-22 and EIBRESP2-11 in the READNEXT when it tries to read second time, first time it reads successfully and response code = 0.
Response code =11 suggests that there is a length error but in the above code i have given 256 as buffer len and buffer allocated exactly to that size, am not able to figure out why its reporting this error (also each line in ESDS is not that long ).
Joined: 06 Jun 2008 Posts: 8232 Location: Dubuque, Iowa, USA
From the CICS Programming Reference manual (link at the top of the page) with emphasis added by me:
specifies the length, as a halfword binary value, of the data area where the record is to be put. On completion of the READNEXT command, the LENGTH parameter contains the actual length of the record.
So the question becomes, where do you set BuffLen back to 256 after the first read? If the second record is longer than the first, you would very definitely get RESP=22, RESP2=11 on a READNEXT.