Natural SQL Gateway can be run in the TP-monitor environments CICS and Com-plete and in TSO and as well as in a z/OS batch environment.
This section covers the following topics:
This section covers the following topics:
In order to access SQL tables from a CICS environment via Natural SQL
Gateway, the Natural SQL Gateway Server has to be deployed. The
NDBPARM
parameters NSBAHOST
and
NSBAPORT
are used to specify the address and port number
of the Natural SQL Gateway server.
Under CICS, a Natural program which accesses a SQL table can also be
run in pseudo-conversational mode (Natural profile parameter
PSEUDO=ON
). In this case, at the end of a CICS task, all SQL
cursors are closed - there is no way to reposition a SQL cursor when the task
is resumed – and the SQL database transaction is commited.
To circumvent the problem of CICS terminating a pseudo-conversational transaction during loop processing and thus causing all SQL cursor to close and lose all selection results, NSB either uses the file server to support the Natural transaction logic or switches from pseudo-conversational mode to conversational mode for the duration of a Natural loop which accesses a DB2 table.
If the file server is not used and the parameter
CONVERS=ON
is set, Natural SQL Gateway switches to conversational
mode whenever a terminal I/O takes place during an open database loop.
To enable multiple Natural sessions to run concurrently, all Natural areas are written to the threads just before a terminal I/O operation is executed. When the terminal input is received, storage is acquired again, and all Natural areas are read from the threads.
In order to support applications, which do not deploy the implicit
commit at CICS terminal I/O and which instead code explicit
ROLLBACK
or COMMIT
to end their database transaction,
a conversational mode 2 has been introduced.
Conversational mode 2 means that a SQL update transaction is spawned
across CICS terminal I/Os until an explicit COMMIT
or
ROLLBACK
is issued.
Conversational mode 2 could be requested by the parameter
CONVRS2=ON
or it can dynamically set or rest by calling the
CALLNAT
program NDBCONV
.
Warning: These kinds of application tend to tie up CICS and DB2 resources, as the resources are not freed across terminal I/O! |
In a CICS environment, the file server is an optional feature to relieve the problems of switching to conversational processing. Before a screen I/O, Natural detects if there are any open cursors and if so, saves the data contained by these cursors into the file server. With the file server, database loops can be continued across terminal I/Os, but database modifications made before a terminal I/O can no longer be backed out.
For a detailed description of the file server, refer to the section Natural File Server for DB2.
In order to access SQL tables from a CICS environment via Natural SQL
Gateway, the Natural SQL Gateway server has to be deployed. The
NDBPARM
parameters NSBAHOST
and
NSBAPORT
are used to specify the address and port number
of the Natural SQL Gateway server.
Natural SQL Gateway can run under TSO without requiring any changes to
the Natural/TSO interface. Just supply the hlq.RCI.LOAD
library
from the CXX Adabas precompiler installation in the JCL.
Apart from z/OS Batch, the batch environment for Natural can also be the
TSO background, which invokes the TSO terminal monitor program by an EXEC
PGM=IKJEFT01
statement in a JCL stream.
In a TSO environment, the file server is an optional feature to be able to emulate during development status a future CICS production environment.
With each terminal I/O, Natural issues a COMMIT
WORK
command to simulate CICS or IMS TM syncpoints. Therefore,
database modifications made before a terminal I/O can no longer be backed
out.
For a detailed description of the file server, refer to the section Natural File Server.
Natural SQL Gateway can run in a z/OS batch environment. Just supply
the hlq.RCI.LOAD
library from the CXX Adabas precompiler
installation in the JCL.