HLDWTR (Hold Writer)

HLDWTR Command syntax diagram

 

Purpose

The Hold Writer (HLDWTR) command stops the specified writer at the end of a record, at the end of a spooled file, or at the end of a printed page. If multiple copies of a file are produced, the writer can be held at the end of the copy currently being produced. The writer is not ended and the device is not made available to the system. The writer remains inactive until a RLSWTR (Release Writer) or ENDWTR (End Writer) command is issued. Data is not lost when the writer is held.

 

Required Parameters

WTR
Specifies the name of the spooling writer being held. Specify the name of the spooling writer.

 

Optional Parameters

OPTION
Specifies when the spooling writer should stop producing output.

*IMMED: The writer stops immediately after it has written the last record, in the current block of records, to the output device. Each time the writer finishes producing a block of records on a device, it makes another I/O request to get the next block from the file being spooled to the device. If *IMMED is specified, the writer stops only after it has written the last record in the block being processed, which (for diskette output) is a complete diskette record being written on diskette.

When *IMMED is specified for printed output, the writer stops anywhere within or at the end of a print line or at the end of a complete block, which may not be at the end of a line. This is because some data records (which are blocked to improve performance) may be split in two, with the first part of a record at the end of one block and the last part of the record at the beginning of the next block. If only one copy of the file is being produced or if the last copy is being produced, the entry for the file is removed from the output queue when the output is completed.

*CNTRLD: The job is ended in a controlled manner. This allows the program to perform cleanup (end-of-job processing).

*PAGEEND: The writer is held at the end of a page. This value is valid only when the spooling writer is a printer writer.

Example for HLDWTR

HLDWTR  WTR(PRINTER)  OPTION(*CNTRLD)

This command stops the writer named PRINTER at the end of the current file. The writer is held until an RLSWTR (Release Writer) or ENDWTR (End Writer) command is issued.

Error messages for HLDWTR

*ESCAPE Messages

CPF1340
Job control function not performed.
CPF3313
Writer &1 not active nor on job queue.
CPF3330
Necessary resource not available.
CPF3331
Not authorized to control writer &3/&2/&1.
CPF3332
Writer &3/&2/&1 already held.
CPF3334
Previous hold to writer &3/&2/&1 pending.
CPF3438
*PAGEEND not valid for writer &3/&2/&1.