12 Multiple Task Programming
Another method is to modify database information indirectly. Any changes are put in a transaction data set or file. Then, at the end of the day, one program locks the entire database and processes the transaction. This method allows more rapid access to the database during the day and ensures that the data remains constant.
The second option is for each program to send its output to a spool file. Then a program can output the spool file contents to the printer at the end of the day or at any specified time. This ensures that other programs will not tie up the printer when output is needed immediately. This is accomplished by using a file name as the device specifier in the PRINTER IS statement. Spool files are described in page 249 . Syntax for the PRINTER IS statement is as follows:
PRINTER IS "file name"
To output the file, use the COPY statement.
PRINTER IS 0 COPY "file name"The third and fourth options include adding a printer to the system. The printer can be added to the system for all terminals to use, or it can be added to a terminal. If one terminal is continually using a printer but the other terminals only use a printer occasionally, add the printer to the busy terminal. If all terminals are keeping the printer busy, add a new printer to the system.