TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-43
Pathsend Requester Example
?PAGE "START THE TMF TRANSACTION"
! The following procedure is called by the MAIN proc to start the
! TMF transaction.
PROC start^the^tmf^transaction;
BEGIN
DBL trans^tag;
INT tmf^error;
INT .buf [0:79];
STR .sbuf := @buf '<<' 1;
STR .sp;
IF (tmf^error := BEGINTRANSACTION (trans^tag))
THEN ! file system error returned in tmf^error
BEGIN
sbuf ':=' "ERROR WITH BEGINTRANSACTION: " -> @sp;
CALL NUMOUT (sp, tmf^error, 10, 3);
@sp := @sp[3];
CALL WRITE (error^log^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (error^log^fnum);
CALL ABEND;
END;
CALL write^trace^file (trace^begin^transaction);
END; ! PROC start^the^tmf^transaction
?PAGE "PROCESS THE STARTUP MSG"
! This procedure is called from the GUARDIAN 90 PROC INITIALIZER
! to save the startup msg, and OPEN the IN and OUT files.
PROC startup^proc (rucb, passthru, msg, msg^len, match) VARIABLE;
INT .rucb;
INT .passthru;
INT .msg (ci^startup);
INT msg^len;
INT match;
BEGIN
INT .buf [0:79];
STR .sbuf := @buf '<<' 1;
STR .sp;
INT FileCode;
INT status;
! Pass the startup msg back because PROC initialize needs access
! to the default volume and subvolume.
passthru ':=' msg for msg^len;
CALL OPEN (msg.infile, in^fnum, open^read^only);
IF <>
THEN ! error opening the input file
BEGIN
sbuf ':=' "FAILED TO OPEN IN FILE" ->@sp;
CALL WRITE (term^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend