OSI/TS Management Programming Manual
Sample Programs
C–24 056786 Tandem Computers Incorporated
spi^err := SSGETTKN ( spi^buf, ZSPI^TKN^ADDR,
tkn, 1,
@event^buf);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Move past length part (variable-length token).
@event^buf := @event^buf + 2D;
! Display the event message at your terminal.
CALL displ^event(event^buf);
! Save context token from this GETEVENT response for
! the next GETEVENT request.
spi^err := SSMOVETKN(ZSPI^TKN^CONTEXT,
spi^buf, 1, ! source
sav^buf, 1); ! destination
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Move the updated command to spi^buf for next time
! through the loop.
spi^buf ':=' sav^buf FOR $LEN(spi^buf) BYTES;
END; ! END of WHILE loop
END;
?PAGE
! ***********************************************************
! * MAIN procedure - dist^intfc *
! ***********************************************************
! This MAIN procedure starts an EMS consumer distributor and
! calls procedures that use SPI commands to connect a source
! collector, to load a filter, and to position the
! distributor within the log files. Then the procedure
! calls the getevent^loop procedure to retrieve and
! process event messages.
PROC dist^intfc MAIN;
BEGIN
! Initialize subsystem IDs.
zems^val^ssid ':=' [ZSPI^VAL^TANDEM,
ZSPI^SSN^ZEMS,
ZEMS^VAL^VERSION];
zos4^val^ssid ':=' [ZSPI^VAL^TANDEM,
ZSPI^SSN^ZOS4,
ZOS4^VAL^VERSION];
! Get terminal name and open terminal.
CALL MYTERM (term^name );
CALL OPEN (term^name, term^file^num);