OSI/TS Management Programming Manual
Sample Programs
056786 Tandem Computers Incorporated C–25
! Open $RECEIVE file.
CALL OPEN (rcv^name, rcv, , 1);
IF <> THEN
CALL DEBUG;
! Read startup message from $RECEIVE.
CALL READUPDATE (rcv, startup^msg, $LEN(startup^msg),
ct^rd);
IF <> THEN
CALL DEBUG;
CALL REPLY ( , , , , 0 );
IF <> THEN
CALL DEBUG;
! Create a name for the distributor process.
CALL CREATEPROCESSNAME (distr^name);
IF <> THEN
CALL DEBUG;
! On the initial open (no SPI), the distributor will get
! the same startup message read by the application, but
! with a parameter string for type (C = CONSUMER).
s^startup^param ':=' "TYPE C";
startup^msg[36] := 0; ! Terminate startup message.
! Start the distributor process.
CALL NEWPROCESS (distr^prog^file, , , , , error,
distr^name);
IF ( ERROR.<0:7> > 0 ) THEN
CALL DEBUG;
! Open the distributor to write the startup message.
CALL OPEN (distr^name, distr);
IF <> THEN
CALL DEBUG;
! Write the startup message--no parameter string.
CALL WRITE (distr, startup^msg, 74 );
! Check for errors--error 70 is continuation.
! (ASSIGNS and PARAMS)
CALL FILEINFO (distr, error );
IF ( NOT ( (error = 0) OR ( error = 70) ) ) THEN
CALL DEBUG;
CALL CLOSE ( distr ); ! Don't send ASSIGNs & PARAMs.
! Get filter name from terminal.
CALL get^filter^name;
! Reopen the distributor for SPI commands and responses.
s^distr^qual ':=' "#ZSPI";
CALL OPEN ( distr^name, distr );
IF <> THEN
CALL DEBUG;