how to solve INVEREQ error in reading a vsam file?

110 Views Asked by At

I want to read all records in a VSAM file using CICS commands. But unfortunately, I encountered error number16 or INVREQ which means ´INVREQ – Read operation not permitted as it is not mentioned in the FCT. Record is locked´ but I dont know how to solve this problem. Before using READNEXT function I used STARTBR which returns the same error. This is the code that I tried for STARTBR.

EXEC CICS STARTBR
   FILE('file-name')
   RIDFLD(data-area) 
   KEYLENGTH(data-value)
   REQID(data-value)
   SYSID(system-name)
   GTEQ
END-EXEC
2

There are 2 best solutions below

0
Will Yates On

How is the file defined within the CSD? There are attributes within the file definition that define if the file can be browsed or not. Might be worth inquiring on the file and checking its definition

1
John Tilling On

The file has to be defined to CICS. On the file definition (when you use CEDA DEFINE FILE) there is an operations section where you set what options are allowed against the file ie add, browse, read, update etc. You need to have these set correctly.