Spooler Programmer's Guide
Sample Perusal Process
Spooler Programmer’s Guide—522287-002
B-8
 CALL NUMIN (str,number, 10, status);
 IF status <> 0 THEN CALL error(2)
 ELSE
 BEGIN
 number := (number - page) + 1;
 IF number < 1 THEN CALL error(2);
 END;
 END
 ELSE number := 1;
 END;
 END;
 !6 EXIT! OTHERWISE ;
 END;
 END;
 END;
 END;
?page
! loc changes the location of the current job
PROC loc (location);
 INT .location;
 BEGIN
 INT error^code;
 job.number := current^job;
 ! Get current state of job
 error^code := SPOOLERSTATUS(supernum,2,0,job);
 IF error^code <> 0 THEN
 BEGIN
 ! Error handling
 CALL err(error^code);
 END
 ELSE
 BEGIN
 ! If job is in ready state, put it in the hold state first
 IF job.state = 2 THEN
 BEGIN
 CALL hold(1);
 ! Change the location of the job
 error^code := SPOOLERCOMMAND(supernum, 2, current^job,
 125, location);
 IF error^code <> 0 THEN
 BEGIN
 ! Error handling
 CALL err(error^code);
 END
 ! Restart job
 ELSE CALL hold(0);
 END
 ELSE ! Or else it is already in hold, open, or print state
 BEGIN
 IF job.state = 4 THEN CALL err(7) !job is printing now
 ELSE
 BEGIN
 ! Change the location of the job
 error^code := 
SPOOLERCOMMAND(supernum,2,current^job,125,location);
 IF error^code <> 0 THEN
 BEGIN
 ! Error handling
 CALL err(error^code);
 END;
 END;
 END;
 END;










