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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-35
Pathsend Requester Example
! Store the server's reply: system name and process name
out^buf.server^reply[i].system^name ':='
cb.pathsend^reply^buf.this^server.system^name
FOR $OCCURS (cb.pathsend^reply^buf.this^server.system^name);
out^buf.server^reply[i].process^name ':='
cb.pathsend^reply^buf.this^server.process^name
FOR $OCCURS (cb.pathsend^reply^buf.this^server.process^name);
! Store Pathsend error msg text and file system error msg text
! generated by this program.
! When an error is retryable we retry the transaction and
! don't include error msg text. If the retries also failed,
! we need to add msg text now.
IF (cb.pathsend^error AND NOT cb.pathsend^error^msg) OR
(cb.file^system^error AND NOT cb.file^system^error^msg)
THEN ! include error msg text
BEGIN
cb.pathsend^error^msg ':=' "PATHSEND ERROR: " -> @sp;
CALL DNUMOUT (sp, $UDBL (cb.pathsend^error), 10, 3);
cb.file^system^error^msg ':=' "FILE SYSTEM ERROR: " -> @sp;
CALL DNUMOUT (sp, $UDBL (cb.file^system^error), 10, 3);
END;
IF cb.pathsend^error^msg
THEN ! include msg text
out^buf.server^reply[i].error^msg.pathsend^error ':='
cb.pathsend^error^msg FOR $OCCURS (cb.pathsend^error^msg);
IF cb.file^system^error^msg
THEN ! include msg text
out^buf.server^reply[i].error^msg.file^system^error ':='
cb.file^system^error^msg FOR $OCCURS (cb.file^system^error^msg);
! Index to next server reply element in output buffer
i := i + 1;
END; ! if
@cb := @cb.next^cb;
END; ! while