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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-33
Pathsend Requester Example
CALL abend^with^my^abend^msg;
sbuf ':=' "FILE SYSTEM ERROR " -> @sp;
CALL NUMOUT (sp, error, 10, 3);
@sp := @sp[3];
! If the error is on a file already opened, include the file name
! in the error msg. If the error occurred while trying to open
! a file, we can't include the file name.
IF fnum <> -1
THEN ! the error occurred on a file already opened
BEGIN
sp ':=' " FILE " -> @sp;
@sp := @sp [len := FNAMECOLLAPSE (filename, sp)];
END;
! Write the msg to the terminal if the error log isn't open
IF error^log^fnum <= 0
THEN ! send output to the home term
BEGIN
CALL MYTERM (filename);
CALL OPEN (filename, OutFnum);
IF <> THEN CALL ABEND;
END
ELSE ! error log file is open
OutFnum := error^log^fnum;
CALL WRITE (OutFnum, buf, @sp '-' @sbuf);
CALL CLOSE (OutFnum);
CALL ABEND;
END; ! PROC IO^error