Spooler Plus Programmer's Guide
Sample Perusal Process
Spooler Plus Programmer’s Guide—522293-003
B-4
? spoolercommand, spoolerstatus, open, write, read, writeread,
? creatoraccessid, stop, myterm)
?list
?page
! This procedure handles errors from the spooler utility procedures
! No error recovery or diagnostic message is displayed; only the error
! number is listed. A finished program would have error recovery, and
! a meaningful diagnostic message would be displayed.
PROC err (errcode);
INT errcode;
BEGIN
STRING err^line [0:39] := ["error^code = ", 26 * [" "]];
INT .ierr^line := @err^line '>>' 1; ! int address of err^line
CALL NUMOUT ( err^line[14], errcode, 10, 10);
CALL WRITE( termnum, ierr^line,30);
END;
! This procedure handles errors from the file I/O procedures
! No error recovery or diagnostic message is displayed; only the error
! number is listed. A finished program would have error recovery, and
! a meaningful diagnostic message would be displayed.
PROC filerr (fnum);
INT fnum;
BEGIN
STRING err^line [0:39] := ["error^code=", 28 * [" "]];
INT .ierr^line := @err^line '>>' 1; ! int address of err^line
CALL NUMOUT ( err^line[14], fnum, 10, 10);
CALL WRITE( termnum, ierr^line,30);
END;
?page
! hold puts the current job in the hold state
PROC hold (holdp);
INT holdp;
BEGIN
INT error^code;
IF holdp THEN
BEGIN
! Put the job in the hold state
error^code := SPOOLERCOMMAND(supernum,2,current^job,122);
IF error^code <> 0 THEN
BEGIN
CALL err(error^code);
! Error handling
END;
END
ELSE
BEGIN
! Start the job
error^code := SPOOLERCOMMAND(supernum,2,current^job,115);
IF error^code <> 0 THEN
BEGIN
CALL err(error^code);
! Error handling
END
END;
END;
?page