STRPRTWTR (Start Printer Writer)

STRPRTWTR Command syntax diagram

 

Purpose

The Start Printer Writer (STRPRTWTR) command starts a spooling writer that moves spooled files from an output queue to a specified printer. The writer, which is a system job, takes spooled files from an output queue and produces (writes) the output on the printer device. This command specifies the name of the printer, the names of the output and message queues used, and the name of the writer.

More than one writer can be active at the same time (as determined by the spooling subsystem description), and up to 10 writers can be active to the same output queue. Each writer must have a unique writer name, its own device, and only one type of writer (print, remote, or diskette) can be active to a single output queue. A writer that has been started can be actively writing output or waiting for a file to be put on the output queue. Optionally, the writer can end automatically when it has processed all the files on the output queue. The writer can also be changed, held, or canceled if the Change Writer (CHGWTR), Hold Writer (HLDWTR), or End Writer (ENDWTR) command is used.

Because each writer runs independent of the job that started it, users can continue doing other work on the system after they have started a writer. The writer is owned by the user who issues the STRPRTWTR command.

 

Required Parameters

DEV
Specifies the name of the printer device used to print the spooled file. The device must be available for allocation before the writer can be started.

*ALL: A printer writer is started for every printer configured on the system.

*SYSVAL: A printer writer is started for the system default printer.

printer-device-name: Specify the name by which the printer device being started is identified.

 

Optional Parameters

OUTQ
Specifies the qualified name of the output queue.

*DEV: The default output queue associated with the printer specified on the DEV parameter is used.

The name of the output queue can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

output-queue-name: Specify the name of the output queue from which the writer processes spooled files.

WTR
Specifies the name of the spooling writer being started. Each writer name must be unique.

*DEV: The name of the writer is the same as that of the printer device specified on the DEV parameter.

writer-name: Specify the name by which the writer being started is identified.

MSGQ
Specifies the qualified name of the message queue to which messages created by the writer are sent.

*DEVD: Messages are sent to the message queue specified in the device description of the device named on the DEV parameter.

*REQUESTER: The messages are sent to the workstation message queue of the workstation of the user who started the process. If this value is specified for a batch job, *DEVD is used.

The name of the message queue can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

message-queue-name: Specify the name of the message queue to which messages created by the writer are sent.

AUTOEND
Specifies whether the writer ends automatically.

*NO: The writer does not end when the last available file has been removed from the output queue. It waits for another spooled file entry to be put on the queue.

Element 1: Ending a Writer Automatically

*YES: The writer automatically ends after it has reached the state specified on Element 2 of this parameter (*NORDYF or *FILEEND).

Element 2: Ending a Writer with a Ready File

*NORDYF: The writer automatically ends when there are no ready files (all the available files have been removed from the output queue).

*FILEEND: The writer ends after it finishes processing one spooled file.

ALWDRTPRT
Specifies whether the printer writer allows files to be printed directly to the printer. A file printed directly to the printer is created by specifying SPOOL(*NO) for a printer file. When direct printing is allowed, the non-spooled printer file is printed immediately if the printer is available or, if the printer is busy, the non-spooled printer file waits until the printer is available. The maximum wait is the length of time specified on the WAITFILE parameter on the printer file, after which the job is automatically canceled. The user can cancel a non-spooled printer file only with an End Job (ENDJOB) command.

*NO: The printer does not allow non-spooled printer files to be printed to the device.

*YES: The printer can be used to print spooled and non-spooled output. See the Create, Change, or Override Printer File (CRTPRTF, CHGPRTF, or OVRPRTF) command to set the value of the WAITFILE parameter.

Note: Nonspooled files wait up to 30 seconds regardless of whether the value specified on the WAITFILE parameter is less than 30 seconds.

FORMTYPE
Specifies the form type selection values that govern which spooled files are produced by the writer. A file's form type is specified in the device file that produced the spooled file. This parameter specifies that only the files with this form type are processed now. Files with other form types are left on the output queue and are available when their forms types are specified.

When a writer is sent to a printer device, a form load message is shown on the user's display if:

  • The printer device has not been configured since it was last varied on.
  • The form type mounted on the printer device does not match the form type of the first file spooled to the printer.

If the previous conditions occur, the form load message instructs the user to load the appropriate form type in the printer device.

To change the type of form for which spooled files are being produced, use the CHGWTR command.

Note: The form load message is issued when the spooled file to be printed has a form type different from the form type of the last spooled file that was printed on the device. The value for the last form type printed is kept from the last STRPRTWTR, CHGWTR, or VRYCFG command issued.

Consider the following example:

  1. The last spooled file printed on printer PRT01 had the form type *STD.
  2. The user changes the form type on PRT01 to XYZ using the following command:
    CHGWTR  PRT01  FORMTYPE(XYZ)
    
  3. No spooled file with the form type XYZ is printed on PRT01.
  4. The user then sends a spooled file with the form type *STD to PRT01. The form load message is not issued, despite the intervening CHGWTR command, because the last spooled file printed on PRT01 had the same form type as the spooled file being printed.

    The form load message would be issued if a spooled file with the form type XYZ were actually printed on PRT01.

Element 1: Type of Form Designation

*ALL: All form types are processed by the writer.

*FORMS: Available files on the output queue with the same form type are processed as a group before the writer moves on to the next form type group. The writer first chooses the first available file on the queue. After the first file is complete, all files with the same form type are processed. The writer again chooses the first available file on the queue and repeats the process for that form type.

*STD: Only files that specify the standard form type are selected.

form-type: Specify the form type of the spooled files being produced.

Element 2: Message Sending Options

*INQMSG: An inquiry message is sent to the message queue when a spooled file has a form type that is different than the form type in the printer.

*INFOMSG: An informational message is sent to the message queue when no spooled files requiring this form type remain in the output queue.

*MSG: An inquiry message is sent to the message queue when a spooled file has a form type that is different than the form type in the printer and an informational message is sent when no spooled files requiring this form type remain in the output queue.

*NOMSG: Neither an inquiry message nor an informational message is sent to the message queue.

FILESEP
Specifies how to control the number of file separator pages that are printed preceding each file.

*FILE: The number of separators specified for each individual file is used.

number-of-file-separators: Specify the number of separator pages to print. Valid values range from 0 through 9. Whenever the user responds to the change form type message indicating that a new form type has been put on the printer, the writer issues a message inquiring how many file separator pages are printed with the new form type.

SEPDRAWER
Specifies which drawer is selected for printing separators.

*DEVD: The value stored in the device description for the printer is used.

*FILE: The separator pages are printed on paper from the same drawer as the rest of the spooled file.

separator-drawer: Specify a value ranging from 1 through 255 to indicate the drawer from which the separator pages are printed.

Note: For some printers, SEPDRAWER(3) implies an envelope drawer.

ALIGN
Specifies how to control the forms alignment.

*WTR: The writer keeps track of the output that is printed and issues a forms alignment message whenever it determines that alignment is needed.

*FILE: The forms alignment message is issued for every file for which ALIGN(*YES) is specified. This option must be selected whenever the automatic forms alignment control provided by the writer does not provide the desired results.

*FIRST: The forms alignment message is issued only for the first file printed. No alignment messages are issued when subsequent errors occur on the printer.

INIT
Specifies how often to initialize the printer device.

Note: This parameter is ignored if TRANSFORM(*YES) or a user data transform program was specified on the printer device description.

*WTR: The writer initializes the printer device when necessary.

*FIRST: The writer initializes the printer device only before the first file is printed, or after a device error occurs.

*ALL: The writer initializes the printer device before each file and each copy of the file is printed.

FILE
Specifies the name of the first (or only) spooled file being processed by the spooling writer and printed. If several files are available on the output queue, the next file produced is the first one available that has the highest priority.

*NONE: No spooled file name is specified. The first spooled file that becomes available on the output queue is processed first.

*LAST: The spooled file which was being printed when the writer ended will start to print when the writer is restarted.

spooled-file-name: Specify the name of the spooled output file that is the first (or only) output file written to the printer.

JOB
Specifies the name of the job that created the spooled file. This parameter is valid only if a spooled file name is specified on the FILE parameter. If no job qualifier is given, all of the jobs currently in the system are searched for the job name.

A job identifier is a special value or a qualified name with up to three elements. For example:

*
job-name
user-name/job-name
job-number/user-name/job-name
More information on this parameter is in Commonly used parameters.

*: The job from which this STRPRTWTR command was entered is the job that created the spooled file.

job-name: Specify the name of the job that created the spooled file.

user-name: Specify the name of the user of the job that created the spooled file.

job-number: Specify the number of the job that created the spooled file.

SPLNBR
Specifies the number of the spooled file being processed first. This parameter is valid only if a spooled file name is specified in the FILE parameter. More information on this parameter is in Commonly used parameters.

*ONLY: One spooled file from the job has the specified file name. The number of the spooled file is not necessary. If *ONLY is specified and more than one spooled file has the specified file name, a message is sent.

*LAST: The spooled file with the highest number and the specified file name is used.

*ANY: The spooled file number is not used to determine which spooled file is used. Use this value when the job system name parameter or the spooled file creation date and time parameter is to take precedence over the spooled file number when selecting a spooled file.>

spooled-file-number: Specify the number of the job's spooled file that is on the specified output queue and that is being processed first.

JOBSYSNAME
Specifies the name of the system where the job that created the spooled file to be processed first (JOB parameter) ran. This parameter is considered after the job name, user name, job number, spooled file name, and spooled file number parameter requirements have been met. This parameter is valid only if a spooled file name is specified in the FILE parameter.

*ONLY: There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and spooled file creation date and time.

*CURRENT: The spooled file created on the current system with the specified job name, user name, job number, spooled file name, spooled file number, and creation date and time is used.

*ANY: The job system name is not used to determine which spooled file is used. Use this value when the spooled file creation date and time parameter is to take precedence over the job system name when selecting a spooled file.

system name: Specify the name of the system where the job that created the spooled file ran.

CRTDATE
Specifies the date and time the spooled file to be processed first was created. This parameter is considered after the job name, user name, job number, spooled file name, spooled file number, and job system name parameter requirements have been met. This parameter is valid only if a spooled file name is specified in the FILE parameter.

*ONLY: There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and job system name.

*LAST: The spooled file with the latest creation date and tim of the specified job name, user name, job number, spooled file name, spooled file number, and job system name is used.

Element 1: Date spooled file was created

date: Specify the date the spooled file was created.

Element 2: Time spooled file was created

*ONLY: There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file creation date.

*LAST: The spooled file with the latest creation time of the specified job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file creation date is used.

time: Specify the time the spooled file was created.>

PAGE
Specifies the number of the first page to print of the first file specified on the FILE parameter.

*BEGIN: Printing begins on the restart page of the spooled file. If the RESTART parameter value is *STRPAGE on the Change Spooled File Attributes (CHGSPLFA) command, then printing begins on the page specified on the PAGERANGE parameter, which is also on the CHGSPLFA command.

page-number: Specify the number of the page on which printing begins. The page number must be within the page range of the file that is to be printed. This value overrides the value specified on the RESTART parameter on the CHGSPLFA command.

Example for STRPRTWTR

STRPRTWTR  DEV(QSYSPRT)  OUTQ(QPRINTS)  WTR(TOM)

This command starts a spooling writer named TOM. This writer takes the output from the output queue named QPRINTS and prints the output on the printer named QSYSPRT. Writer messages are sent to the system operator's message queue, and the writer waits for more output when the queue is emptied.

Error messages for STRPRTWTR

*ESCAPE Messages

CPF0906
A duplicate job named &3/&2/&1 was found.
CPF1338
Errors occurred on SBMJOB command.
CPF1764
Writer already started for device &1.
CPF1842
Cannot access system value &1.
CPF2115
Object &1 in &2 type *&3 damaged.
CPF2207
Not authorized to use object &1 in library &3 type *&2.
CPF3303
File &1 not found in job &5/&4/&3.
CPF3305
Output queue &1 in library &2 assigned to another writer.
CPF3309
No files named &1 are active.
CPF3310
Writer &1 already started.
CPF3330
Necessary resource not available.
CPF3340
More than one file with specified name found in job &5/&4/&3.
CPF3342
Job &5/&4/&3 not found.
CPF3343
Duplicate job names found.
CPF3347
Device &1 not found.
CPF3357
Output queue &1 in library &2 not found.
CPF3362
Objects in QTEMP not valid for parameter values.
CPF3363
Message queue &1 in library &2 not found.
CPF3369
Device &1 not printer device.
CPF336B
Not found or not authorized to driver exit program &1 in library &2.
CPF3418
Duplicate file &1 number &2 found in job.
CPF346A
Transform exit program &1 in library &2 not found or user is not authorized.
CPF346B
Driver exit program &1 in library &2 not found or user is not authorized.
CPF3463
Output queue for device &1 not found.
CPF3464
Not authorized to output queue &1 in library &2.
CPF3478
File &1 not found in job &5/&4/&3 on output queue &6 in library &7.