TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-15
Pathsend Requester Example
! The following dummy procedure is for example program version control
PS^EXAMPLE^VERSION^PROC;
?PAGE "PRINT A MESSAGE TO THE TERMINAL AND ABEND"
! Many procedures check for error conditions that, under normal
! circumstances, should not happen. In these cases, before
! ABENDing, a procedure will call this procedure to write a message
! to the home terminal. This proc calls ABEND.
PROC abend^with^my^abend^msg;
BEGIN
INT .filename [0:11];
INT term^fnum;
INT .buf [0:79];
STR .sbuf := @buf '<<' 1;
STR .sp;
CALL MYTERM (filename);
CALL OPEN (filename, term^fnum);
IF <>
THEN ! print an error msg and abend
CALL IO^error (term^fnum);
sbuf ':=' "INTERNAL ERROR DETECTED, PROGRAM ABENDING" -> @sp;
CALL WRITE (term^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (error^log^fnum);
CALL CLOSE (term^fnum);
CALL ABEND;
END; ! PROC abend^with^my^abend^msg
?PAGE "ABORT THE TRANSACTION"
!
! Abort the transaction I started
!
PROC abort^tmf^transaction;
BEGIN
INT tmf^error;
INT .buf [0:79];
STR .sbuf := @buf '<<' 1;
STR .sp;