Predict Version 3.4 or above is a prerequisite for the installation of Adabas Native SQL. Please check which version of Predict is installed.
The Adabas files and fields that will be used by Adabas Native SQL application programs must be defined in the data dictionary.
Version 2.2B of the COBOL compiler is a prerequisite for successful use of Adabas Native SQL. If you use an older version of the compiler, the object modules generated by your compiler may not be compatible with the Software AG-supplied routines RESPINT, PRTRACE and PRTFLOW; in this case, you must recompile these three routines from the source files supplied on the medium.
This document covers the following topics:
If you are using System Maintenance Aid (SMA), refer to the SMA documentation (included on the current edition of the Natural documentation CD).
If you are not using SMA, use the procedure described below. In this procedure, the values specified below must be supplied. To copy the datasets from medium to disk, perform the following steps:
This step is not necessary if you have already copied the library SRVnnn.LIB from another Software AG medium. For more information, refer to the element #READ-ME in this library. The library SRVnnn.LIB is stored on the medium as the sequential file SRVnnn.LIBS containing LMS commands. The current version nnn can be obtained from the Software AG Product Delivery Report. To convert this sequential file into an LMS-library, execute the following commands:
/IMPORT-FILE SUPPORT=*TAPE(FILE-NAME=SRVnnn.LIBS, - / VOLUME=<volser>, DEV-TYPE=<tape-device>) /ADD-FILE-LINK LINK-NAME=EDTSAM, FILE-NAME=SRVnnn.LIBS, - / SUPPORT=*TAPE(FILE-SEQ=3), ACC-METH=*BY-CAT, - / BUF-LEN=*BY-CAT, REC-FORM=*BY-CAT, REC-SIZE=*BY-CAT /START-EDT @READ '/' @SYSTEM 'REMOVE-FILE-LINK EDTSAM' @SYSTEM 'EXPORT-FILE FILE-NAME=SRVnnn.LIBS' @WRITE 'SRVnnn.LIBS' @HALT /ASS-SYSDTA SRVnnn.LIBS /MOD-JOB-SW ON=1 /START-PROG $LMS /MOD-JOB-SW OFF=1 /ASS-SYSDTA *PRIMARY
Where:
<tape-device> | is the device-type of the tape, e.g. TAPE-C4. |
<volser> | is the VOLSER of the tape. |
To copy the procedure COPY.PROC to disk, call the procedure P.COPYTAPE in the library SRVnnn.LIB:
/CALL-PROCEDURE (SRVnnn.LIB,P.COPYTAPE), - / (VSNT=<volser>, DEVT=<tape-device>)
If you use a TAPE-C4 device, you may omit the parameter DEVT.
To copy all Software AG product files from medium to disk, enter the procedure COPY.PROC:
/ENTER-PROCEDURE COPY.PROC, DEVT=<tape-device> If you use a TAPE-C4 device, you may omit the parameter DEVT. The result of this procedure is written to the file 'L.REPORT.SRV'.
If a different Adabas interface module is to be used instead of the standard module ADAUSER, Adabas Native SQL must be relinked. The procedure PLINK can be used to link ADASQL.
The prelinked Adabas Native SQL module is in SQLnnn.MOD, and it has the name SQLPRE.
The module ADAUSER reads ADARUN parameters via SYSDTA. If an alternative module is used, this dataset may not be needed.
Modify (edit) the supplied procedure PSQL as required and then execute the example programs. The following specifications in the procedures should be adapted to suit the system environment. The names of the procedure parameters are given in square brackets [ ], and the default values are given in parentheses ( ).
The Adabas module library [&ADABAS] that contains the module ADARUN and the Adabas link modules (SAG.ADABAS.MOD;)
Language-specific files (e.g., TSOS.COB1.RTSMODLIB(&COBLIB) for COBOL; TSOS.FOR1.MODLIB(&FORLIB) for FORTRAN; TSOS.PLI1.MODLIB(&PL1LIB), TSOS.PLI1.TEXT.E(&PL1TEXT) for PL/I);
The language [&LANG(COBOL)] in which the application program is
written. This is specified by a procedure parameter coded as
ADA
or COBOL
or
FORT
or PL1
;
The membername [&SOURCE] of the program to be preprocessed (CEX1);
The following SQL precompile parameters: [&DB(1)] the DBID where the Predict data is kept; [&FDIC(11)] the file number of the Predict FDIC file; [&FNAT(8)] the file number of the FNAT file; [&ABORTFILE(8)] the file number for the ABORT parameter;
The following ADARUN data: [&DB(1)] the DBID where the Predict data is kept; [&IDTNAME(ADABAS5B)] the IDTNAME where the DBID runs;
[&SQLLIB($SAG.SQL.MOD)] the Adabas Native SQL module library;
[&SQLPROC($SAG.SQL.CSQL)] the Adabas Native SQL executable module.
The global parameters for Adabas Native SQL, which are stored in the file D.ADAGLOB (FCBTYPE=SAM, RECFORM=V), must also be modified.
The error message texts for decoding preprocessor-time errors are typically stored in the Natural system file, specified by the global SYSFILE FNAT parameter.
The error messages for decoding run-time errors are typically stored in
the data dictionary file. If this is not the case, use the global parameter
ABORT FILE
to specify the location (number) of this
file.
See chapter Global Parameters in the Adabas Native SQL Reference Manual for further information.
Typical global parameter definitions:
SYSFILE FDIC=(1,11) FNAT=(1,8). LANG COBOL. XREF ON. ABORT FILE=8.
Before testing the examples, check that the files EMPLOYEES and VEHICLES are loaded, and that they are documented in the Predict data dictionary. If the file definitions are not yet present in the data dictionary, they can be loaded from the file PRDnnn.DEMO, which can be found on the Predict installation medium. The notation nnn represents the Version, Release and SM level of Predict at your site. Ensure that the relationships for soft coupling are defined in the data dictionary. If you wish to use Adabas Native SQL to preprocess FORTRAN programs, ensure that the necessary language synonyms are defined in the data dictionary. See for example Appendix B in the Adabas Native SQL Reference Manual.
The procedure PSQL executes the following steps:
Preprocess the program with Adabas Native SQL;
Compile the preprocessed program (ADA, COBOL, FORTRAN or PL/I);
Link-edit the program. The following modules may be called by the user program at runtime:
COBOL | PL/I | Description |
---|---|---|
RESPINT (C) | RESPINT (C,P) | Error handling routine. |
PRTRACE (C) | PRTRACE (C,P) | Runtime trace routine. Activated by the error handling
routine if MODE TRACE is set.
|
PRTFLOW (C) | PRTFLOW (C,P) | Runtime Adabas Native SQL statement printing. Activated if
MODE FLOW is set.
|
FINDCID (A) | FINDCID (A) | Generates dynamic Adabas command IDs. Activated if
OPTION DYNAMCID is set.
|
PRPABEND (A) | PRPABEND (A) | Terminates program execution. Called by the error handling routine. |
SQFRDATE (C) | SQFRDATE (C) | Routine which converts format D number to numeric date. |
SQFRTIME (C) | SQFRTIME (C) | Routine which converts format T number to numeric date and numeric time. |
SQTODATE (C) | SQTODATE (C) | Routine which converts numeric date to format D number. |
SQTOTIME (C) | SQTOTIME (C) | Routine which converts numeric date and numeric time to format T number. |
Ada | FORTRAN | Description |
---|---|---|
RESPF (F) | RESPF(F) | Error handling routine. |
PRTRAC (F) | PRTRAC (F) | Runtime trace routine. Activated by the error handling
routine if MODE TRACE is set.
|
PRTFLO (F) | PRTFLO (F) | Runtime Adabas Native SQL statement printing. Activated if
MODE FLOW is set.
|
FCID (A) | FCID (A) | Generates dynamic Adabas command IDs. Activated if
OPTION DYNAMCID is set.
|
PRPABEND (A) | -- | Terminates program execution. Called by the error handling routine. |
SQFRDATE (C) | SQFRDATE (C) | Routine which converts format D number to numeric date. |
SQFRTIME (C) | SQFRTIME (C) | Routine which converts format T number to numeric date and numeric time. |
SQTODATE (C) | SQTODATE (C) | Routine which converts numeric date to format D number. |
SQTOTIME (C) | SQTOTIME (C) | Routine which converts numeric date and numeric time to format T number. |
Notes:
ABORT PLI
should be coded. The procedure as supplied
links the standard Adabas interface module ADAUSER to the application program.
If a different module is used, the procedure must be modified
accordingly.
Finally, the linked program (load module) is stored with the name M.membername;
Execute the program.
All listings generated by this procedure are given names starting with L. (SYSLST, SRCLINK, ERRLINK).
If the program is to be passed through other preprocessors in addition to Adabas Native SQL, the corresponding job step should be included in the procedure following the Adabas Native SQL step and preceding compilation.
The files used by Adabas Native SQL are listed below:
Name | Description |
---|---|
ADAGLOB | The global parameter definitions. |
ADAIN | The source program to be preprocessed. |
ADAMES | Adabas Native SQL writes messages at preprocessing time to this dataset. |
ADAOUT | The output of the preprocessor. Embedded Adabas Native SQL statements in the source program appear in this file as comments and are followed by the generated Ada, COBOL, FORTRAN or PL/I code. |
ADAOUT1 | A temporary work file. |
ADDOUT | A temporary work file. |
DDLNKPAR | Defines the IDTNAME on which the Native SQL is running (for the ADALNK module. |
SYSLST | Adabas Native SQL writes messages to this file if it abends. |
These files are defined in the procedure PSQL. Each file name is prefixed with "D", for example D.ADAMES.
At run time, the execution of the Adabas Native SQL program requires the presence of a link name DDLIB which points to the Adabas Library containing the ADALNK. Also present, must be a link name DDLNKPAR pointing to a file containing: ADALNK IDTNAME=<idtname> where <idtname> is the BS2000 IDTNAME on which the database data to be accessed is available. The application program generated by Adabas Native SQL uses the following file names to refer to files (in addition to any other user-defined files):
Name | Description |
---|---|
SYSLST | If the FLOW facility is used, the flow-tracing output is written to this file. |
TSTDMP | If the TRACE facility is used, the trace output is written to this file. |