Version 4.2.6 for Mainframes
 —  Database Management System Interfaces  —

Natural Transaction Logic with VSAM

Natural for VSAM uses the transaction logic of the environment it is running in. Thus, the results of the Natural END TRANSACTION and BACKOUT TRANSACTION statements (see also the relevant sections in Natural Statements with VSAM) differ depending on the actual environment:


With Native VSAM

Since VSAM itself has no transaction logic, there is no transaction logic available if Natural is working in a native VSAM environment. This is the case under Com-plete, TSO, and in batch mode, which means when NVSMISC is the I/O module in use.

With NVSMISC, END TRANSACTION and BACKOUT TRANSACTION statements do not return any error messages, but are ignored by the Natural interface to VSAM.

Top of page

Under CICS

Under CICS, VSAM files can be defined as "recoverable resources" or for RLS as "recoverable sphere", all of which are synchronized by CICS using the concept of "logical units of work" (LUWs). An LUW ends if a SYNCPOINT command is issued or if the CICS task is terminated. For details, refer to the relevant IBM literature on CICS.

Below is information on:

NVSCICS Module

For CICS, the I/O module NVSCICS is a normal command-level application program. It transfers END TRANSACTION and BACKOUT TRANSACTION statements to the NATCICS driver which issues the EXEC CICS SYNCPOINT and EXEC CICS ROLLBACK commands. If an error occurs in a Natural session with uncommitted updates and no error transaction is supplied, Natural itself triggers the interface to VSAM to issue a ROLLBACK command.

If a SYNCPOINT or ROLLBACK command fails (for example, when CICS answers with a ROLLEDBACK condition to a SYNCPOINT request), error messages NAT3544 or NAT3545 are returned.

Conversational Tasks

If the Natural session runs in CICS conversational mode, the LUW is not ended by a terminal I/O. Natural runs in conversational mode if either the Natural parameter PSEUDO=OFF has been specified or Natural itself has determined that pseudo-conversational processing is not possible.

Since terminal I/Os do not disturb the transaction logic of an application as long as Natural is running in conversational mode, a program like the following one would work without problems:

Example:

READ vsam-file
 UPDATE
 INPUT ...
END-READ
BACKOUT TRANSACTION

Pseudo-Conversational Tasks

If the Natural session is running in pseudo-conversational mode, each terminal I/O terminates the CICS task, thus implicitly performing a SYNCPOINT. Therefore, the impact of a BACKOUT TRANSACTION statement, that is of an EXEC CICS SYNCPOINT ROLLBACK command, only goes back to the most recent terminal I/O. The example program above would, therefore, end with error message NAT3548, because it is not possible to roll back all the updates.

Note:
Keep in mind that all messages of the Natural interface to VSAM are issued at runtime only, since the Natural compiler is not able to detect this kind of logical error.

Top of page

Under DFSMStvs

DFSMS Transactional VSAM Services (DFSMStvs) provides the same features CICS provides: forward and backward recovery logging, backout processing and a two-phase commit process. An LUW ends if the RRS (Resource Recovery Service) call SRRCMIT or SRRBACK is issued (END TRANSACTION or BACKOUT TRANSACTION). For details, refer to the relevant IBM literature on DFSMStvs and RRS.

Top of page