SpoolCmd: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Also see the [[PRINTING]] chapter.
SPOOLCMD is mainly useful for producing print files for Linux and MAC systems. In Windows systems the DIRECT://printer-name is preferred. Also see the [[PRINTING]] section.


Basically, SpoolCmd provides a description of how to print data sent to the printer.
Basically, SpoolCmd provides a description of how to print data sent to the printer.
Line 25: Line 25:
The '''[QUEUE]''' and '''[PRINTER]''' parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.
The '''[QUEUE]''' and '''[PRINTER]''' parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.


The following is an example of the SPOOLCMD specification used with the WBSPOOL utility (see [[WBSPOOL.EXE]] in the [[Other Changes/Enhancements]] section for more information:)
The following is an example of the SPOOLCMD specification used with the WBSPOOL utility:  


  SPOOLCMD wbspool -Q[PRINTER] -E [&ERRNO][SPOOLFILE]
  SPOOLCMD wbspool -Q[PRINTER] -E [&ERRNO][SPOOLFILE]

Revision as of 20:03, 29 October 2013

SPOOLCMD is mainly useful for producing print files for Linux and MAC systems. In Windows systems the DIRECT://printer-name is preferred. Also see the PRINTING section.

Basically, SpoolCmd provides a description of how to print data sent to the printer.

Business Rules supports independent spoolers on all systems. The BRConfig.sys SPOOLCMD specification will make a shell call to issue the necessary spool command whenever printing is done. When this is invoked the spooler is responsible for removing the spool file created by Business Rules.

The spool command and its parameters can be specified in a CONFIG command or in the BRConfig.sys file as follows:

Business Rules can also make substitutions as follows in parameters specified with SPOOLCMD:

[SPOOLFILE] substitutes the name of the spool file, as determined by Business Rules.

[NAME=] substitutes the name of the printer file as specified in the OPEN display statement's NAME= string. For example, PRN:/10.

[QUEUE] substitutes the queue name as specified in the OPEN display statement. In the following example, "queue" would be substituted for [QUEUE]: PRN:queue/10.

[PRINTER] substitutes the "printerclass" string as specified in the OPEN display statement. For example, PRN:/printerclass.

[WSID] substitutes the workstation ID as specified at start-up or by the BRConfig.sys WSID spec.

[PROGRAM] substitutes the name of the program that is loaded at the time that the printer is closed.

The [QUEUE] and [PRINTER] parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.

The following is an example of the SPOOLCMD specification used with the WBSPOOL utility:

SPOOLCMD wbspool -Q[PRINTER] -E [&ERRNO][SPOOLFILE]

NOTE: The spoolfile created by Business Rules will not automatically be deleted.

On DOS and Windows, if CONFIG SPOOLCMD is not specified, it opens to PRN: and will return error 6298 if the printer is not ready.

SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The new SPOOLCMD syntax is:

  SPOOLCMD [@] [-w] command  parm-1 parm-2 ...

SPOOLCMD honors BR drive substitution on the command itself, for example:

 DRIVE  J:,M:\myapp,j,\
 SPOOLCMD J:\mylib\spooler [SPOOLFILE] [COPIES]

This finds 'spooler' in M:\myapp\mylib.

See also: