TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-46
Pathsend Requester Example
?PAGE "SUBPROC TO WRITE A VALIDATION ERROR MSG"
!
! If a record is invalid, write an error msg to the error log file
!
SUBPROC output^msg;
BEGIN
CALL WRITE (error^log^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (error^log^fnum);
! Save the error msg so we can include it in the output record
global^non^pathsend^error^msg ':=' sbuf FOR @sp '-' @sbuf;
END; ! SUBPROC output^msg
?PAGE "BEGIN BODY OF VALIDATE BREQ INPUT"
FOR i := 0 to 1 DO
BEGIN
IF input^rec.server^request[i].server^class = [15*[" "]]
THEN ! Invalid request
BEGIN
sbuf ':=' "INVALID REQUEST: SERVER CLASSES MUST BE SPECIFIED" ->
@sp;
CALL output^msg;
RETURN false;
END;
IF (input^rec.server^request[i].pathmon^assign^name = [31*[" "]] AND
input^rec.server^request[i].pathmon^system^and^process^name =
[15*[" "]])
THEN ! invalid request
BEGIN
sbuf ':=' "INVALID REQUEST: ASSIGN NAME " -> @sp;
sp ':=' "OR SYSTEM AND PROCESS NAME MUST BE SPECIFIED" -> @sp;
CALL output^msg;
RETURN false;
END;
IF (input^rec.server^request[i].pathmon^assign^name <> [31*[" "]] AND
input^rec.server^request[i].pathmon^system^and^process^name <>
[15*[" "]])
THEN ! invalid request
BEGIN
sbuf ':=' "INVALID REQUEST: BOTH ASSIGN AND SYSTEM " -> @sp;
sp ':=' "AND PROCESS NAMES CAN'T BE SPECIFIED" -> @sp;
CALL output^msg;
RETURN false;
END;
! No format errors detected with server class names and PATHMON
! ASSIGNs and process names.
IF input^rec.server^request[i].pathmon^assign^name <> [31*[" "]]
THEN ! try to get the ASSIGN name
BEGIN
logical^name ':=' input^rec.server^request[i].pathmon^assign^name