Information Technology Reference
In-Depth Information
5.8
Implementation of the Relational Interface
We can implement the relational interface by translating an embedded-SQL Cobol
program source to DL/1 Cobol program source code. The types of relational opera-
tions addressed include Select, Join, Update, Insert, and Delete. Figure 5.10 shows
the data flow diagram of the relational interface.
The relational interface software scans the Cobol source program, filtering em-
bedded-SQL commands, and passing them to the SQL command analyzer. The soft-
ware determines the type of operation in the extracted SQL command by analyzing
the command tokens. Some tokens, such as Table Name, Field Name, Conditions,
and Host Variable, are saved. The recognized relational operation type is used to
find the corresponding template macro in the macro file.
The macro file contains the embedded DL/1 (Data Language I, IMS database
management language) in Cobol statements for emulating one embedded-SQL Co-
bol command. Each operation has its own macro for the segment and field to be
changed depending on the operation. The use of the macro variables lets the seg-
ment names be substituted when the macro is expanded. Each variable indicates
where a parameter is required. The variable name is preceded by “!” and delimited
by “^” and has a maximum length of eight as required by DL/1. For example, TAB_
NAME on the first line of the following sample macro is the name of a variable that
is replaced, in this case, by a table name.
Macro input
sequential
file
Template
input
file
View input
sequential
file
Embedded
SQL Cobol
source
program
Program
Conversion
Prototype
Embedded
DL/1
Cobol source
ID division
to data division
temporary i/o file
Procedure division
temporary
I/O file
Paragraphs
temporary
I/O file
Fig. 5.10 System diagram of the program translation
Search WWH ::




Custom Search