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

SPI Programming in COBOL
SPI Programming Manual427506-006
7-3
Interprocess Communication
.
.
MOVE COBOL-VAL-TRUE TO ZTMF OF ZPWY-DDL-DEF-PROG.
or
IF ZTMF OF ZPWY-DDL-DEF-PROG = COBOL-VAL-FALSE . . .
or
IF ZTMF OF ZPWY-DDL-DEF-PROG NOT = COBOL-VAL-FALSE . . .
.
.
It is recommended that you use the comparison NOT = false-value rather than =
true-value, in case a subsystem uses a value other than -1 for TRUE.
It is a good idea to put the declarations of COBOL-VALUE-TRUE and COBOL-VALUE-
FALSE into a COPY library and copy it into each program that needs the definitions, in
case future versions of HP software change the data type used in COBOL for Boolean
fields.
Interprocess Communication
These considerations apply to communication with subsystem servers using SPI
messages.
Selecting the External File
In the Environment Division of your program, you must use a SELECT clause to
identify the external file to which the server file is connected. If your server has a fixed
process name, use a SELECT clause similar to:
SELECT SERVER-FILE ASSIGN TO "$TRPM".
If your server does not have a fixed name, include a SELECT clause such as:
SELECT SERVER-FILE ASSIGN TO "#DYNAMIC".
Then (for a non-fixed-name server) use the COBOLASSIGN utility routine to assign the
process name at run time.
Starting the Server
To start any servers that your application starts dynamically, use the
CREATEPROCESS utility routine.
If a server that you start dynamically honors assign and param messages, and you
want to allow the user of your application to provide these messages to the server, you
should compile your application with the ?SAVEALL directive. Doing this ensures that
assign and param messages are saved and passed on.