Protecting table resources

Table services provide a resource protection mechanism designed to prevent concurrent updating of the same table by more than one user. This protection mechanism assumes that for all users having update access to a given table, the same library name is used in the first statement defining the table for the table library. This can be ISPTLIB or another specified library. Other libraries can be specified by the use of the LIBRARY keyword or the LIBDEF service.

When a table is opened or created in write mode, an exclusive enqueue is requested for a resource name consisting of the first library name defined in the ISPTLIB, or the first library name defined in the LIBRARY DD or the top file specified in the LIBDEF Service stack, concatenated with the table name. The TBOPEN or TBCREATE service fails with a return code of 12 if this enqueue or lock is unsuccessful. A successful enqueue or lock stays in effect until the completion of a TBEND or TBCLOSE service for the table. If the NAME parameter is specified on the TBSAVE or TBCLOSE service, an additional exclusive enqueue or lock is issued. The resource name consists of the first library name defined in the ISPTLIB, or the first library name defined in the LIBRARY DD or the top file specified in the LIBDEF Service stack, concatenated with the name specified in the NAME parameter. If this enqueue or lock fails, the service terminates with a return code of 12 and the table is not written.

The table output library represented by the ISPTABL definition or specified library name is protected from concurrent output operations from any ISPF function through a separate mechanism not specific to table services.

The first data set in the ISPTLIB concatenation should be the same as the data set used for ISPTABL. This ensures predictable behavior of dialogs that use table services without specifying the LIBRARY keyword.