General Information

This section covers the following topics:


Purpose

With the Natural interface to SQL/DS, a Natural user can access data in an SQL/DS database. Natural for SQL/DS is supported in CICS and batch environments under z/VSE.

In general, there is no difference between using Natural with SQL/DS and using it with Adabas, DB2 or DL/I. The Natural interface to SQL/DS allows Natural programs to access SQL/DS data by using the same Natural DML statements that are available for Adabas, DB2 and DL/I. Therefore, programs written for SQL/DS tables can also be used to access Adabas, DB2 or DL/I databases. In addition, Natural SQL statements are available.

All operations requiring interaction with SQL/DS are performed by the Natural interface module.

Environment-Specific Considerations

Natural for SQL/DS can be run in the TP-monitor environment CICS and in z/VSE batch mode.

Important:
As all dynamic access to SQL/DS is performed by NDBIOMO, all users of Natural for SQL/DS must have RUN privilege on the package NDBIOMO. If running in static mode, users must also have RUN privilege on all static SQL/DS packages.

This section covers the following topics:

Natural for SQL/DS under CICS

Under CICS, Natural uses the SQL/DS online support to access SQL/DS. Therefore ensure that this attachment is started. If not, the Natural session is abnormally terminated with CICS abend code AEY9, which leads to Natural error message NAT0954 if the Natural profile parameter DU is set to OFF.

Since Natural for SQL/DS does not issue any explicit CONNECT statements, it takes advantage of the implicit CONNECT facility of the SQL/DS online support.

Under CICS, a Natural program which accesses an SQL/DS table can also be run in pseudo-conversational mode. Then, at the end of a CICS task, all SQL/DS cursors are closed, and there is no way to reposition an SQL/DS cursor when the task is resumed.

To circumvent the problem of CICS terminating a pseudo-conversational transaction during loop processing and thus causing SQL/DS to close all cursors and lose all selection results, Natural switches from pseudo-conversational mode to conversational mode for the duration of a Natural loop which accesses an SQL/DS table.

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.

Natural for SQL/DS in z/VSE Batch Mode

An explicit connection to the database must be performed. The sample program DEM2CONN can be used for this purpose. DEM2CONN calls the DB2SERV module with function code U which in turn calls the database connect services.

Integration with Predict

Predict, Software AG's open, operational data dictionary for fourth-generation-language development with Natural, is a central repository of application metadata and provides documentation and cross-reference features. Predict lets you automatically generate code from definitions, enhancing development and maintenance productivity.

Since Predict supports SQL/DS, direct access to the SQL/DS catalog is possible via Predict, and information from the SQL/DS catalog can be transferred to the Predict dictionary to be integrated with data definitions for other environments.

SQL/DS databases, tables and views can be incorporated and compared, new SQL/DS tables and views can be generated and Natural DDMs can be generated and compared. All SQL/DS-specific data types and the referential integrity of SQL/DS are supported. See the relevant Predict documentation for details.

In addition, Predict active references support static SQL for SQL/DS.

Integration with Natural Security

When run in an environment that is controlled by Natural Security, the use of certain features of Natural for SQL/DS can be restricted by the security administrator, for example:

  • Static SQL

    Static generation can be disallowed by

    • restricting access to the Natural system library SYSSQL,

    • disallowing the module CMD,

    • restricting access to the libraries that contain the relevant Natural objects,

    • disallowing one of the Natural system commands CATALOG or STOW for a library that contains relevant Natural objects.

    If a library is defined in Natural Security and the DBID and FNR of this library are different from the default specifications, the static generation procedure automatically switches to the DBID and FNR specifications defined in Natural Security.

For further information, ask your security administrator.

Messages Related to SQL/DS

The message number ranges of Natural system messages related to SQL/DS are 3700-3749 4750 - 4799, 6700 - 6799 and 7386-7395.

For a list of error messages that may be issued during static generation, see Static Generation Messages and Codes Issued under NDB/NSQ in the Natural Messages and Codes documentation.

Terms Used in this Documentation

Term Explanation
DB2 DB2 refers to IBM's DB2 UDB for z/OS.
DBRM Database request module
DDM Data definition module.
DML Data manipulation language (Natural).
NSQ This is the product code of Natural for SQL/DS. In this documentation the product code is often used as prefix in the names of data sets, modules, etc.
SQL/DS SQL/DS refers to IBM's DB2 Server for VSE and VM.