SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming in COBOL
SPI Programming Manual427506-006
7-4
Communicating With the Server
Communicating With the Server
Except in the case of the EMS collector process ($0), use the OPEN verb to open the
server, and use the READ WITH PROMPT verb to send commands to it.
To open the EMS collector process to send commands to it or to report events, you
must use the utility routine COBOL^SPECIAL^OPEN. To open the collector to send
commands to it, specify $0.#ZSPI in the SELECT clause. To open the EMS collector
to send event messages to it, specify $0 in the SELECT clause. For more information
about COBOL^SPECIAL^OPEN, see the
COBOL85 Reference Manual
.
After you have opened $0.#ZSPI using COBOL^SPECIAL^OPEN, you send
commands to it using READ WITH PROMPT, just as for any other server process.
However, after opening $0 using COBOL^SPECIAL^OPEN, you send event messages
to it using the WRITE verb.
Writing a Server in COBOL
If you are writing a subsystem server, you should include COPY statements for the
sections of the SPI definition files (and any other HP definitions) you use, as you would
in writing a requester. You must also set up the file (FD) and copy the
subsys-DDL-
MSG-BUFFER definition.
A subsystem should open $RECEIVE for I-O to receive SPI messages and then use
the READ verb to read the messages and WRITE to send the replies.
SPI Procedure Syntax in COBOL
To call the SPI procedures from a COBOL program, use the COBOL ENTER TAL
feature just as you would to call other operating system procedures. For complete
descriptions of the SPI procedures and their parameters, see Section 3, The SPI
Procedures.
Note. Always call the procedures SSGET, SSMOVE, and SSPUT for both token codes and
token maps in COBOL. SSPUTTKN, SSGETTKN, and SSMOVETKN are not needed or
recommended in COBOL programs.