CHGWTR (Change Writer)
Purpose
The Change Writer (CHGWTR) command allows the user to change the form type, number of file separators, and output queue attributes of an active printer writer. This capability provides the best performance when you want to process all files of one form type or output queue, and then all files of another form type or output queue, instead of ending and restarting the writer or changing to a different output queue each time.
If changes are made while the writer is in hold (HLD) status, the changes do not take effect until after the writer is released. The change is then made based on the value specified on the OPTION parameter.
Required Parameters
- WTR
- Specifies the simple name of the printer writer being changed. Each writer name must be unique.
*SYSVAL: The writer name of the system default printer is changed.
writer-name: Specify the name of the writer being changed.
Optional Parameters
- OUTQ
- Specifies the qualified name of the output queue.
*SAME: The output queue being used is not changed.
*DEV: Specifies the default output queue associated with the printer 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.
- FORMTYPE
- Specifies the form type selection codes for which the spooled files are being produced by the writer. A file's form type is originally derived from the form type specified in the device file that produced the spooled file. This parameter specifies that only the files of this form type are produced by the writer. All other files are left on the output queue as available.
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 last form type printed is kept from the last STRPRTWTR, CHGWTR, or VRYCFG command issued. Consider the following example:
- The last spooled file printed on printer PRT01 had the form type *STD.
- The user changes the form type on PRT01 to XYZ using the following command:
CHGWTR PRT01 FORMTYPE(XYZ)- No spooled file with the form type XYZ is printed on PRT01.
- 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
*SAME: The value does not change.
*FORMS: All available files with the same form type are produced as a group before the writer moves on to the next form type. The writer initially chooses the first available file on the queue. After the first file is complete, all files with the same form type as the first are processed. The writer again chooses the first available file on the queue and repeats the process.
*ALL: All form types are produced by the writer.
*STD: Only files that specify the standard form type are selected.
form-type: Specify the type of form for which the spooled files are produced.
Element 2: Message Sending Options
*SAME: The value does not change.
*INQMSG: An inquiry message is sent when the current file has a form type that is different than the one loaded on the device.
*INFOMSG: An informational message is sent when the writer runs out of files with the specified form type.
*NOMSG: No informational message is sent when the writer runs out of files with the specified form type. Also, no inquiry message is sent when the current file has a form type that is different than the one loaded on the device.
*MSG: The writer sends an informational message when it runs out of files with the specified form type. If the printer writer does not end, (specified by the AUTOEND parameter on the STRPRTWTR command), then as additional spooled files become available for printing they are produced. The informational message is sent each time the writer must wait for additional spooled files.
- FILESEP
- Specifies the number of file separator pages to print preceding each file.
*SAME: The value does not change.
*FILE: Print the number of file separator pages that is specified for each individual file.
number-of-file-separators: Specify the number of file separator pages to print.
- SEPDRAWER
- Specifies which drawer is selected for printing file and job separators.
*SAME: The value does not change.
*DEVD: The value stored in the device description for the printer is used.
*FILE: The separator pages are printed from the same drawer as 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.
- OPTION
- Specifies when the writer change occurs.
*NORDYF: The writer change occurs when there are no files on the output queue that meet the writer's current form type selection requirements.
*FILEEND: The writer change occurs at the end of the current file.
Example for CHGWTR
CHGWTR WTR(MYWTR) FORMTYPE(MYFORM *NOMSG) OPTION(*FILEEND)This command changes writer MYWTR, which has been producing files of some other form type, to produce files with a form type of MYFORM at the end of the file now being produced. The writer is also prevented from sending an informational message when it runs out of eligible files with form type MYFORM.
Additional Considerations
By using the CHGWTR command to control the form type being produced by a writer, the operator can improve efficiency by minimizing the number of form changes required. On the other hand, if the print writer's output queue has a large number of spooled files with the wrong form type, which must be bypassed by the writer, then writer output queue search time increases and total system performance may decrease.
It is possible to enter another change writer command for a writer before the previous change has taken place. When this is done the later change is not queued, but it updates the first change instead. For example, if the command
CHGWTR WTR(WRKL) OUTQ(QPRINT) OPTION(*FILEEND)is entered, then (before the change takes place) the command
CHGWTR WTR(WRKL) FORMTYPE(XYZ *SAME) OPTION(*FILEEND)is entered, the output queue of writer WRKL changes to QPRINT, and the form type is changed to XYZ when the writer finishes producing the current file.
Whenever the output queue or form type is changed for a writer, the print writer starts searching the output queue from the beginning and selects the first available file on the queue. This occurs even if the change takes place between two SCHEDULE(*JOBEND) files of the same job.
Error messages for CHGWTR
*ESCAPE Messages
- CPF1842
- Cannot access system value &1.
- CPF2207
- Not authorized to use object &1 in library &3 type *&2.
- CPF3313
- Writer &1 not active nor on job queue.
- CPF3330
- Necessary resource not available.
- CPF3331
- Not authorized to control writer &3/&2/&1.
- CPF3357
- Output queue &1 in library &2 not found.
- CPF3456
- Cannot change writer &1 to output queue &4 in library &5.
- CPF3457
- Cannot change writer &1.
- CPF3458
- Change writer &1 not allowed. End writer pending.
- CPF3459
- Writer &1 not eligible for change.
- CPF3460
- Change writer &1 not allowed.
- CPF3463
- Output queue for device &1 not found.
- CPF3464
- Not authorized to output queue &1 in library &2.
- CPF9803
- Cannot allocate object &2 in library &3.