TechTip: Vary Off Controllers with Printers Attached PDF Print E-mail
Tips & Techniques - Document Management
Written by MC Press Contributing Author   
Monday, 06 May 2002 18:00

Occasionally, there is a need to vary off a controller. Most shops have several printers attached to a controller, which means that several ENDWTR commands must be executed against these printers. During one of these ENDWTR marathon events (I had to do three controllers), I thought to myself, "There has to be a better way." The next day, I wrote ENDCTLWTR.

This utility consists of one command and one CL program. The ENDCTLWTR command ends all print writers on a specified controller. The command also allows you to select the method for ending the writers (*CNTRLD, *IMMED, *PAGEEND).

ENDCTLWTR runs program END001C. END001C uses the Work with Configuration Status (WRKCFGSTS) command to create a spooled file that lists the status of all of the devices attached to the specified controller. The spooled file is transferred to a physical file in QTEMP, where records are scanned for devices with a status of ACTIVE/WRITER. For each match, the device name is extracted from the file and an ENDWTR command is issued.

To compile END001C, you must create the temp file TPACTWTR in QTEMP first. This can be easily done by issuing this command: CRTPF FILE(QTEMP/TPACTWTR) RCDLEN(132). Then, compile the program END001C interactively. Or add it as a pre-run command if using Turnover or another change management software package.

Click here to download code.

--Keith Reischl
Sr. iSeries Technical Analyst

MCMagOnline pays for tips!
Send your tips to

MC Press Contributing Author
About the Author:
Last Updated on Thursday, 11 June 2009 16:40
User Rating: / 0