User guide

Interface Procedures
Host Language Interface
058058 Tandem Computers Incorporated 6–15
Figure 6-4. COBOL Host Language Program (Page 3 of 3)
ELSE
IF DATA-COUNT EQUAL ZERO
MOVE 1 TO END-FLAG
ELSE
DISPLAY RECEIVED-DATA.
C-EOJ.
DISPLAY "END OF RUN".
MOVE 0 TO ERROR-NUMBER.
ENTER "ENFORMFINISH" USING CTLBLOCK.
IF ERROR-NUMBER NOT EQUAL ZERO
DISPLAY "ENFORMFINISH ERROR: " ERROR-NUMBER.
In the second example, there is a need to do something with customers’ orders for
parts. Given a customer name and an order date, the part number and order number
are returned for each part ordered by the customer on that date.
A TAL host language program is written to process those records. The ENFORM
interface locates the desired records with considerably fewer lines of code than
required by the host language.
Data is used from the customer, order, and odetail files of the sample relational data
base. Refer to Appendix C.
The record description defined in the dictionary for the information returned to the
host language program contains a field for the order number (ordernum) and part
number (partnum). The DDL RECORD statement is shown in Figure 6-5.
Figure 6-5. DDL Description of Records Passed to TAL Program
RECORD order-process.
05 ordernum PIC 999.
05 partnum PIC9(4)
END
The ENFORM query in Figure 6-6 contains one FIND statement and uses parameters
specified by the user in Command Interpreter PARAM command (the PARAM
command is passed to the TAL program in the Command Interpreter PARAM
message). to communicate to the query processor the specific customer name and
order date for the records to be processed. Refer to the GUARDIAN Operating System
Programmer’s Guide for the Command Interpreter PARAM message format. For each
part number and order number returned via ENFORMRECEIVE, some operation is
performed. This portion of the example is left to your discretion.