User guide

Interface Procedures
Host Language Interface
058058 Tandem Computers Incorporated 6–21
Figure 6-10. FORTRAN Host Language Program (Page 2 of 2)
C Run the query by calling ENFORMSTART. Note that the
timeout
parameter
C (continuation line A) must be passed as a double word. Otherwise, ENFORMSTART
C cannot find the parameters following
timeout
.
CALL ENFORMSTART (CONTROLBLOCK,
1 COMPILEDQUERY,
2 \36\,
3 ERRORNUMBER,
4 \1\,
5 \0\,
6 \0\,
7 \0\,
8 \0\,
9 \0\,
A \int4(0)\,
B \0\,
C \MASK
C Check the error number obtained through the query:
IF (ERRORNUMBER.EQ.0) GO TO 2
WRITE (6,*) 'ERROR=', ERRORNUMBER
STOP
C Retrieve the data using the query. Print out each record returned. To print data
C (character or numeric) stored in ASCII, use the A format. To print numeric data
C stored in binary, use the I format. (If your DDL says TYPE BINARY or specified
C COMPUTATIONAL, then the data is stored in binary). In this example, "empnum"
C is stored in ASCII, but "age" is stored in binary.
1 WRITE (6,200) IX, BUF^BUF2^EMPNUM, BUF^BUF2^EMPNAME,
1 BUF^BUF2^JOB, BUF^BUF2^AGE
IX=IX+1
2 COUNT = ENFORMRECEIVE (CONTROLBLOCK, BUF^BUF1^BUFFER)
IF (COUNT.NE.0) GO TO 1
CALL ENFORMFINISH(CONTROLBLOCK)
C Formatting:
200 FORMAT (I4, ': ', A4, 2X, A18, 2X, A12, 2X, I2)
STOP
END