While running an application program with CA Datacom/DB, I received an error - UPDATE FOR READ ONLY TABLE, with a RC 06(006).

Document ID : KB000018792
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Running my application program with CA Datacom/DB resulted in a RC 06(006) error, and a PXX dump and messages:


 	DB02405I - PXX START myjob 363 06(006) SELFR-123-ttt 	
 	DB02406I - PXX END - UPDATE FOR READ ONLY TABLE 

What has happened and how do I correct it?

Solution:

First, here is the error description of the RC 06(006) from the CA Datacom/DB Message Reference Guide:

*****
Explanation: A command was issued to read a table with update intent or to modify a table for which there was no update authorization. If your program issues UPDAT, ADDIT, DELET, or RDUxx commands, or issues SELxx commands without using a separate Index Area for temporary indexes (see the MUF startup option CBS parameter for the ID of the database used by the Compound Boolean Selection Facility and SQL), the parameter UPDATE=YES must be specified in the User Requirements Table.

User Response: Change the User Requirements Table definition to permit updating by specifying UPDATE=YES in the DBURTBL macro for the table to be updated, then reissue the request.
*****
To summarize this, it would appear that this error results from using a URT with this program that does not say UPDATE=YES for table ttt in DB 123.

Please check the table definitions for the URT that is being used, and if you have this situation, either use a different URT or update this one accordingly.

There is also a solution to address this problem. For version 12.0 it is RO37862 (DB 12.0 #350), and for version 14.0, it is RO46955 (DB 14.0 #160). These are both titled "INVALID RETURN CODE 06(006) WHEN TABLE IS OPEN FOR UPDATE" and they have this description:
*****
Problem Description: User application receives a CA Datacom/DB return code 06(006) in error when issuing an ADDIT, any type of read for update command or SELFR. This can occur when the URT has two occurrences of the same table name and DBID -- one with update access and the other occurrence without update access.

Symptoms: CA Datacom/DB returns a return code of 06(006), TABLE NOT OPEN FOR UPDATE, in error to the calling application program when update was specified in the URT table entry.
*****

If reviewing your URT shows that the error description or the problem description applies, please apply RO37862 or RO46955 as appropriate, then try to run this job again. A short-term circumvention to this situation is reassemble and relink the URT, removing the read-only occurrence of the table.

As always, please contact CA Technologies support for CA Datacom if you have further questions.