TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-29
Pathsend Requester Example
CALL DEVICEINFO (error^log^file, devtype, phys^reclen);
IF devtype.<4:9> = 6 !type term!
THEN ! Do a setmode so we can write to an un-paused TERM.
CALL SETMODE (error^log^fnum, 12, 0, 1);
CALL OPEN (msg^log^file, msg^log^fnum, open^write^only LOR open^shared
LOR open^nowait^disk, retry^path^failures);
IF <>
THEN ! open failed
BEGIN
sp ':=' "FAILED TO OPEN MESSAGE LOG FILE" -> @st;
CALL WRITE (term^fnum, buf, @st '-' @sp);
IF <
THEN ! print an error msg and abend
CALL IO^error (term^fnum);
CALL IO^error (msg^log^fnum);
END;
CALL CLOSE (term^fnum);
END; ! PROC initialize
?PAGE "START ONE I/O IN THE TRANSACTION"
! This procedure uses data in the control block (cb) to start a
! Pathsend send or message log WRITE. The I/O is nowaited, and the
! I/O tag is the cb address. If we fail to initiate the
! SERVERCLASS_SEND_, then call analyze^send^error^233 to get the
! associated Pathsend error and file system error.
! This application treats initiation errors as non-retryable.
INT PROC initiate^IO (cb);
INT .EXT cb (control^block^template);
BEGIN
INT len;
INT ^ScSendOpNum;
INT pathmon^process^name^len;
INT serverclass^name^len;
INT flags := 0;
DBL timeout;
INT error;
STR .sp;
! If this is a msg log control block then start the write to the msg
! log file.
IF cb.type = cb^type^msg^log
THEN ! start the disc op
RETURN initiate^write^to^message^log (cb);