Version 2.4.1
 —  Adabas Native SQL Reference Manual  —

USING ADABAS NATIVE SQL STATEMENTS IN TP PROGRAMS

This chapter describes the procedures that must be observed when writing teleprocessing application programs under COM-PLETE, CICS or UTM that issue Adabas Native SQL statements.

No special precautions need to be taken when writing programs that are to run under BS2000/OSD/RTIO, z/VM, TSO or equivalent compatible systems. Programs should be coded in exactly the same way as batch programs.

See also the Adabas Programmer's Guide for Teleprocessing Applications.

This document covers the following topics:


COM-PLETE

TP application programs that are to run under the control of Software AG's COM-PLETE TP monitor should be coded in exactly the same way as batch programs.

The COM-PLETE utility program USCHC can be used to set the default hard-copy device to 0, so that output produced by DISPLAY statements will be sent to the user's terminal.

Top of page

Customer Information Control System (CICS)

The CICS Transaction Work Area (TWA) provides a standardized interface for passing parameters to the program. The first six words of the TWA are used by Adabas Native SQL for communication with CICS. Alternatively, the user may choose to use the COMMAREA. Refer to the global parameter MONITOR.

The CICS command level interface for Ada, COBOL, FORTRAN and PL/I ensures that programs written in these languages will be quasi-reentrant.

Programs can be written in CICS pseudo-conversational mode with the aid of the SAVE and RESTORE statements. Programs that use this facility must not use the ISNSIZE option.

Adabas Native SQL provides an easy way of defining parameters for generating the CICS code. For further information, see the global parameter MONITOR.

See also the global parameter CICS STUB.

Passing Parameters to Adabas

The addresses of the Adabas control block, format buffer, record buffer, search buffer, value buffer and ISN buffer are passed in the same manner for all releases of CICS. These addresses must be placed in the first six words of the TWA. Software AG provides an Assembler subroutine, ADASTWA, which places the parameter address in the TWA. The Adabas/CICS interface routine, ADALNC, retrieves these addresses from the TWA. This module must be used instead of the standard Adabas interface routine, ADALNK. The Ada, COBOL, FORTRAN or PL/I program should call ADASTWA with the TWA as the first parameter; the next six parameters are the customary parameters as used with Adabas direct calls.

Compiling and Executing Adabas Native SQL/CICS Programs

CICS applications programs that use Adabas Native SQL statements must be processed in the following order:

  1. Run the program through the Adabas Native SQL preprocessor;

  2. Run the program through the CICS preprocessor;

  3. Compile the program in the normal manner;

  4. Link-edit the program. An INCLUDE statement must be coded to force the inclusion of the subroutine ADASTWA (Ada, COBOL and PL/I) or ADATWA (FORTRAN);

  5. Execute the program.

COBOL TP Programs Using Adabas Native SQL and CICS (Command Level)

The following global option parameters must be specified when preprocessing COBOL programs:

ADACALL ADASTWA USING TWA. 
TELE "EXEC CICS LINK PROGRAM ('ADABAS') END-EXEC". 
ABORT RESPCICS CICS. 

The ADACALL parameter causes each 'CALL ADABAS' statement to be replaced by a 'CALL ADASTWA' statement. The TELE parameter causes the CICS command level instruction to be inserted after every Adabas command. The ABORT parameter causes the call to the response code analysis module 'RESPCICS' to be called in a "CICS" way.

Alternatively 'MONITOR CICS.' may be used.

Also, the TWA must be declared in the linkage section of the program and the address of the TWA must be made available.

FORTRAN Programs Using Adabas Native SQL and CICS (Command Level)

The code for FORTRAN programs is identical to that for COBOL; however ADASTWA (supplied in the Adabas source library) must be changed to ADATWA.

PL/I TP Programs Using Adabas Native SQL and CICS (Command Level)

The following global option parameters must be specified when preprocessing PL/I programs:

ADACALL ADASTWA USING TWA. 
TELE "EXEC CICS LINK PROGRAM ('ADABAS');". 
ABORT RESPCICS CICS. 

The ADACALL parameter causes each 'CALL Adabas' statement to be replaced by a 'CALL ADASTWA' statement. The TELE parameter causes the CICS command level instruction to be inserted after every Adabas command. The ABORT parameter causes the call to the response code analysis module 'RESPCICS' to be called in a "CICS" way.

Alternatively, 'MONITOR CICS.' may be used.

Also, the TWA must be declared and its address must be made available.

If you implement a multiple-step transaction under UTM, the contents of the control block are lost. You should therefore use the SAVE and RESTORE statements before and after every screen-IO. Also, Adabas must be running in get-next mode, this means specify no ISNSIZE.

Top of page