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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-44
Pathsend Requester Example
CALL IO^error (term^fnum);
CALL IO^error (in^fnum);
END;
! The IN file must be an EDIT file, so verify that now
CALL FILEINFO (in^fnum,,,,,,,,, FileCode);
IF FileCode <> 101
THEN ! illegal file type
BEGIN
sbuf ':=' "INFILE MUST BE TYPE EDIT (101)" -> @sp;
CALL WRITE (term^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (term^fnum);
CALL ABEND;
END;
! Setup the edit control block (a GLOBAL array) for calls
! to EDITREAD.
IF (status := EDITREADINIT (edit^control^block, in^fnum, 1024))
THEN ! print an error msg and abend
CALL IO^error (in^fnum);
CALL OPEN (msg.outfile, out^fnum);
IF <>
THEN ! error opening the output file
BEGIN
sbuf ':=' "FAILED TO OPEN OUT FILE" -> @sp;
CALL WRITE (term^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (term^fnum);
CALL IO^error (out^fnum);
END;
END; ! PROC startup^proc