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.
This document covers the following topics:
Adabas Native SQL consists of two datasets. To determine how to correctly position the tape in the next two sections Loading Files from Magnetic Tape and Loading of Error Messages please refer to the Report of Tape Creation.
To position the tape for the TAPE LOAD command, calculate the number of tape marks as follows:
If the sequence number of SQL23n.TAPE - as shown by the Report of Tape Creation - is n, you must position over 3n-2 tape marks (that is, FSF 1 for the first dataset, FSF 4 for the second, etc.).
Access the disk that is to contain the Adabas Native SQL installation files as minidisk.
Ask the system operator to attach a tape drive to your virtual machine at the address X'181' and mount the Adabas Native SQL installation tape.
When the tape has been attached, enter the VM/CMS command:
TAPE REW
Position the tape by entering the VM/CMS command:
TAPE FSF n
where n is calculated as above (3n-2).
Load the Adabas Native SQL/VM/CMS installation material with the VM/CMS command:
TAPE LOAD * * <minidisk>
You may wish to keep the tape drive attached to your virtual machine, because the tape is still needed in the installation procedure.
The other dataset of the SQLnnn tape is an error messages dataset for the Adabas Native SQL preprocessor. The dataset name is SQLnnn.ERRN. The following commands can be used to load the error messages:
TAPE REW FILEDEF CMWKF02 SLn VOLID SQLnnn (LRECL 4624 BLCKSIZE 4628 RECFM VB) FILEDEF CMPRT01 DISK SQLnnn INPL A NAT3vs MAINPR=1,STACK=(LOGON SYSERR;ERRLODUS;FIN) TAPE RUN
Where n represents the label defined in the Report of Tape Creation and vs represents the Natural version and SM level.
Modify (XEDIT) the supplied EXECs ADASQLC, ADASQLF, ADASQLP and ADAGO as required for execution of the sample programs. The following specifications in the EXECs may be adapted to suit the system requirements.
It may be necessary to provide the LINK and ACC statements necessary to acquire access to the Adabas virtual machine and to the Adabas text library.
It may be necessary to provide the LINK and ACC statements necessary to acquire access to the COBOL system libraries for the COBOL compiler.
The FILEDEF cards may be modified to point to different minidisks.
The COBOL compile options (parameters) may be modified.
In the ADAGO.EXEC, the LOAD statement may need to be modified
depending on which global parameters are used. The module FINDCID is included
only if the global parameter OPTIONS DYNAMCID
is
specified. The module PRTFLOW is included if the the global parameter
MODE FLOW
is specified. These modules will work in both
COBOL and PL/I application programs.
In PL/I only environments, overhead can be further reduced by performing the following:
Compile routines RESPPL1, PRTRACP and PRTFLOP.
Code global parameter ABORT RESPPLI PLI
in
ADAGLOB ADASQL.
In the LOAD statement, replace RESPINT, PRTRACE and PRTFLOW with RESPPL1, PRTRACP and PRTFLOP.
The EXEC as supplied loads the standard Adabas interface module Adabas for the application program. If a different module is used, the EXEC must be modified accordingly.
The global parameters for Adabas Native SQL must also be modified by editing (XEDIT) ADAGLOB ADASQL fm.
Note that the DDFILE parameter has been replaced by the SYSFILE parameter. Adjust the FDIC and FNAT parameters accordingly.
If the error message texts are stored in a file other than the data
dictionary file, the parameter FNAT
should be used to
specify the number of this file. The error message texts are typically stored
in the Natural system file (FNAT).
See chapter Global Parameters in the Adabas Native SQL Reference Manual for further information.
Typical global parameter definitions:
SYSFILE FDIC=(DBID,FNR) FNAT=(DBID,FNR). OPTIONS SOFT=ON NONDE=Y PREFIX=''. XREF ON. LANG COBOL.
The Adabas runtime parameters must also be modified by editing (XEDIT) DDCARD ADASQL fm. See the Adabas CMS Installation Manual for information regarding parameter usage.
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 tape. The notation nnn represents the Version, Release and SM level of Predict at your site. 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.
It may be necessary to increase the storage capacity of the virtual machine that will execute the Adabas Native SQL preprocessor. To inquire on the amount of storage the virtual machine has, execute the following z/VM command:
Q STOR
If the response indicates that there is less than 2048k available, enter the following z/VM commands:
DEFINE STOR 2M IPL CMS
The EXEC ADASQLC, ADASQLF or ADASQLP executes the following:
Prompt for the file name, file type and mode. File name will be the name of the example to be compiled, file type must always be source, and mode is the letter corresponding to the minidisk where the source of the example is contained (i.e. CEX1 SOURCE C).
Preprocess the program with Adabas Native SQL.
Compile the preprocessed program (COBOL, FORTRAN, PL/I).
The following modules may be called by the user program at runtime:
Ada | COBOL | FORTRAN | PL/I | Description |
---|---|---|---|---|
RESPF (F) |
RESPINT (C) |
RESPF (F) |
RESPINT (C,P) |
Error handling routine. |
PRTRAC (F) |
PRTRACE (C) |
PRTRAC (F) |
PRTRACE (C,P) |
Runtime trace routine.Activated by the error handling routine
if MODE TRACE is set.
|
PRTFLO (F) |
PRTFLOW (C) |
PRTFLO (F) |
PRTFLOW (C,P) |
Runtime Adabas Native SQL statement printing. Activated if
MODE FLOW is set.
|
FCID (A) |
FINDCID (A) |
FCID (A) |
FINDCID (A) |
Generates dynamic Adabas command IDs. Activated ifOPTION DYNAMCID is set.
|
PRPABEND (A) |
PRPABEND (A) |
-- | PRPABEND (A) |
Terminates program execution. Called by the error handling routine. |
SQFRDATE (C) |
SQFRDATE (C) |
SQFRDATE (C) |
SQFRDATE (C) |
Routine which converts format D number to numeric date. |
SQFRTIME (C) |
SQFRTIME (C) |
SQFRTIME (C) |
SQFRTIME (C) |
Routine which converts format T number to numeric date and numeric time. |
SQTODATE (C) |
SQTODATE (C) |
SQTODATE (C) |
SQTODATE (C) |
Routine which converts numeric date to format D number. |
SQTOTIME (C) |
SQTOTIME (C) |
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.
Upon completion, notification is made as to the location of files created during preprocess and compilation. You should review these files for error and/or warning messages before continuing.
Execute the ADAGO EXEC.
If the program is to be passed through other preprocessors in addition to Adabas Native SQL, the additional preprocessor(s) should be included in the EXEC following the Adabas Native SQL step and the preceding compilation.
Adabas Native SQL refers to datasets using the following names:
FILEDEF | Description |
---|---|
ADAIN | The source program to be preprocessed. |
ADAOUT | The output of the preprocessor. Embedded Adabas Native SQL statements in the source program appear in this dataset as comments and are followed by the generated COBOL or PL/I code. |
ADAGLOB | The global parameter definitions. |
ADAMES | Adabas Native SQL writes messages at preprocessing time to this dataset. |
SYSUT1 | A temporary work file. |
SYSDBOUT | Error messages are written to this dataset. |
SYSOUT | Adabas Native SQL writes messages to this dataset if it abends. |
At run time, the application program generated by Adabas Native SQL refers to datasets using the following names (in addition to any other user-defined datasets):
FILEDEF | Description |
---|---|
SYSOUT | If the FLOW facility is used, the flow-tracing output is written to this dataset. |
TSTDMP | If the TRACE facility is used, the trace output is written to this dataset. |
With Adabas Version 5, a DATADEF must be issued for the following files:
DATADEF | Description |
---|---|
DDPRINT | Adabas writes messages to this dataset at run time. |
DDCARD | Adabas parameters that are used by the ADARUN module at run time. |