Assigning Print Spooler Specifications

The SP-ASSIGN command changes how the Spooler handles the output produced in an account. It changes the default form queue assignment and other print output specifications. Any changes made remain in effect until the next time the is issued, or until the user logs to another account or logs off. To reset the assignments to the original default options, use SP-ASSIGN with no options.

SP-ASSIGN sets the current Spooler assignments and specifies the number of copies to be printed, print job priority, and the destination of the print job.

Format

SP-ASSIGN [options]

Parameter(s)

options

Can be any of the following (more details about each option follow this list):

?

Displays the current SP-ASSIGNments and the device assigned to the currently assigned output queue.

n

Assigns the number of copies to be printed. Up to 125 copies can be assigned.

A

Directs spooler output to the terminal AUX port connected to the process requesting print-job de-spooling.

C

Chokes printer output to the speed of the printer. The C option must be used with the I option.

Fform

Assigns a specified form queue to the user’s process. form can be any number from 0 to 250.

H

Saves output as a hold file.

I

Specifies immediate printing.

O

Keeps print files open, allowing multiple print requests to be processed as one print job. See also the SP-OPEN/SP-CLOSE commands.

Rpfile

Reassigns print files generated by mvBASIC PRINT ON statements.

S

Suppresses printing of a print job.

T

Sends output to the tape device or floppy disk drive.

Any of a list of options can be used. Options need not be enclosed in parentheses and can be entered in any order. They need not be separated by spaces or commas. The following sections look at the most basic options:

?

Reports the assignment status.

Fn

Assigns a form queue.

n

Specifies the number of copies to print.

I

Specifies that job is to begin printing immediately.

The options for creating hold files, suppressing printer output, and sending output to tape drive or floppy disk drive are covered later in separate sections. For a complete list of the options for the SP-ASSIGN command, see the Guide to mvBase Files and Accounts.

The SP-ASSIGN statement can also be placed in a Logon Proc for the account. This ensures that the assignment will be established each time the user logs on. (This is necessary only if you want to maintain a form queue assignment other than the default.)

Listing the Assignment Status (?)

The ? option displays the current status of the SP-ASSIGN command for the user’s process. A sample status report is shown below:

>SP-ASSIGN ?

PROCESS

STATUS

COPIES

FORM #

4

P

1

0

>

 

 

 

The report has four columns of information:

PROCESS

Your process number.

STATUS

Code indicating how to handle print jobs generated in this account.

COPIES

Number of copies to print for each print job.

FORM #

Form or output queue assigned to this account.

The following table lists the status codes that appear in the SP-ASSIGN report. These status codes correspond to SP-ASSIGN options.

Code

Description

A

Output to the terminal AUX port connected to the process.

C

Choke printing process.

H

Output to a hold file.

I

Print immediately.

O

Keep print file open.

P

Output to the printer.

T

Output to tape or floppy disk.

" "

(null) Suppress any output.

If you use ? with other options, the report will reflect the changes made by the options.

Assigning a Form Queue with the Fn Option

The F option is used to change the form queue assignment for the user’s process. When you change the form queue, it remains in effect until you log to another account or log off. The form queue assignment will also be restored to the default setting the next time you use the SP-ASSIGN statement. Thus, to retain the present form queue, you must specify it again whenever you make any other change.

The following example assigns process 4 to form queue 3 and displays the new assignment:

>SP-ASSIGN F3?

PROCESS

STATUS

COPIES

FORM #

4

P

1

3

>

 

 

 

If you enter the I option, for instance, without specifying the F option, the default form queue assignment 0 will take effect. Thus, to preserve the form queue assignment of 3, you must specify:

>SP-ASSIGN IF3

Selecting the Number of Copies (n)

The n option assigns the number of copies to be printed. If n is not specified, one copy is printed. When multiple copies are assigned, the print file is not released until the last copy is printed. If either the T (tape) or the C (choke) options are used, the n option is ignored.

The following example assigns the number of copies to be printed to 20:

>SP-ASSIGN 20?

PROCESS

STATUS

COPIES

FORM #

4

P

20

0

>

 

 

 

Setting Job Priority (I)

Normally, a print file is not output until it is closed; that is, until all the output is generated. The I (immediate print) option starts the print job as soon as the first frame of output becomes available. The Spooler must finish any currently active print job before it handles the job. All other jobs must wait for the immediate print job to finish before they can be output. Although using the I option usually means that your print job begins printing sooner, it might also mean other jobs are unnecessarily delayed. This is particularly true of large immediate print jobs. Immediate print jobs are processed in the order in which they are entered. If either the T (tape) or the H (hold file) options are used, the I option is ignored; the I option has no effect if the S (suppress printing) option is used.

The following example assigns form queue 1 to process 4 and specifies that subsequent print jobs should be handled immediately, once the printer is free.

>SP-ASSIGN F11?

PROCESS

STATUS

COPIES

FORM #

4

PI

1

1

>

 

 

 

Creating a Hold File

The Spooler normally collects the output for a print job in a print file; as each frame of data is output, that frame is returned to the Overflow Table. The Spooler also allows you to specify that output be retained as a hold file and held until the user dispenses with it.

The SP-ASSIGN command is used to specify that hold files be generated. The following sets of options modify how the Spooler handles each subsequent print job.

HS

Creates a hold file. Do not output the print file.

H or HP

Creates a hold file and print the job as well.

P

Prints the job. Do not create a hold file.

S

Suppresses printing. Do not create a hold file or print file.

In the following example, two commands are issued. The first command uses SP-ASSIGN to specify that the Spooler should retain the output as a hold file and not send any output to the printer. The second command is an INFO/ACCESS statement that specifies printed output. The resulting message indicates that the output was retained as a hold file.

>SP-ASSIGN F11?

PROCESS

STATUS

COPIES

FORM #

8

H

1

1

>LIST CUSTOMERS LPTR

HOLD ENTRY # 9

>

To manipulate hold files in the queue, you must use the SP-EDIT command, which is discussed in the next section.

Collecting Output in a Single Print File

You can collect the output from consecutive print requests and send it to the Spooler as a single job.

Open Option (O)

The O (open) option of the SP-ASSIGN command keeps a print file open until it is explicitly closed. The print file does not start printing until the file is closed. To close the print file, re-execute the SP-ASSIGN command, retaining all options except the O option. Logging off will also close an open print file.

The following example creates a hold file using form queue 2 and leaves the print file open. Several print requests are sent before the print job is closed by reissuing the SP-ASSIGN statement without the O option:

>SP-ASSIGN HSF2O?

PROCESS

STATUS

COPIES

FORM #

4

H

0

1      2

>SORT ORDERS WITH DATE >= 05/01 AND DATE <= 05/31 (P)

HOLD ENTRY # 24

>SORT ORDERS WITH DATE >= 06/01 AND DATE <= 06/30 (P)

>SORT ORDERS WITH DATE >= 07/01 AND DATE <= 07/31 (P)

>SP-ASSIGN HSF2

[1140] YOUR OPEN FILES WERE CLOSED

>

The SP-OPEN and SP-CLOSE commands have been superseded by the SP-ASSIGN command. SP-OPEN activates the O option of SP-ASSIGN; SP-CLOSE deactivates (turns off) the O option. SP-OPEN and SP-CLOSE are useful, however, because they do not affect the SP-ASSIGNments currently in effect, as does SP-ASSIGN O.

See Also

Using the Print Spooler

Starting the Print Spooler

Reinitializing the Print Spooler

Assigning a Printer to a Form Queue with the ASSIGNFQ Command

Checking the Print Queue

Cancelling Print Jobs

Manipulating Hold Files

Using the Print Spooler with Backup Media

Using Procs for Printer, Tape and Floppy Disk Control

Scheduling the Windows Print Spooler