CL (Clear)

The CL (Clear) command clears all exception flags maintained by the operating system for a peripheral unit, and, in some cases, clears the FORMID for the unit and terminates tasks that are using that unit. The FORMID for the unit is not cleared when the unit is in use and you enter the CL command.

Syntax

Explanation

CL <device type> <unit number list>

Clears the devices in the specified unit number list.

Note: If you clear a device assigned to a task, the task might be discontinued immediately.

Examples

Example 1

This command requests that the operating system clear tape unit 116. The system response shows that it has cleared the unit:

CL MT 116
     MT 116 CLEAR

Example 2

This command clears line printers 10 through 12. The system responses show that it has cleared units 10 and 12. Because an I/O operation on LP11 is still in process when you issue the command, the CONTROLLER returns the WILL BE CLEAR message for that unit.

CL LP 10-12
       LP 10 CLEAR
       LP 11 WILL BE CLEAR
       LP 12 CLEAR

Considerations for Use

The action of the CL command depends on the system type and on the status of the unit. The following text shows how the system handles the CL command for units in various states.

CL Actions for Disk Packs

When you enter the command CL PK or CL DK, use the following table to interpret the information that the system reports.

Suspended, No Path, or Not Ready?

In Use by MCP?

Action Code

Yes

Don't Care

CANCEL

No

Yes

CANCEL

No

No

None

CL Actions for Units Other Than Disk Packs

When you enter the command CL followed by a device mnemonic other than PK or DK, use the following table to interpret the information that the system reports.

Suspended Unit?

In Use by User Task?

Action Code

Yes

Yes

DS*

Yes

No

CANCEL

No

Yes

DS

No

No

None

Action Codes

The action codes shown previously are defined as follows.

Code

Description

DS

All queued I/O operations are canceled, and the task using the unit is discontinued with a DS (Discontinue) command. However, DS does not override a previous QT (Quit) command if the unit is controlled by the print server.

DS*

Same as DS except that, if the unit is a printer in use by the print server, the task is terminated with a QT command instead of a DS command.

CANCEL

All I/O operations to the unit are canceled until subsequent operating system or operator action occurs. For example, you must release packs with a CLOSE (Close Pack) command.

None

No operations are canceled, and no tasks are discontinued.

Effects of the CL Command on Selected Unit Types

In general, the CL command does not work on disk or pack units unless the unit is assigned to an operating system procedure such as RECONFIGURE GROUP. For example, CL works only if a mix number appears in the OL (Display Label and Paths) command display for the unit.

If a tape unit that is in use is assigned to a task, the system discontinues the task if it was not already terminated with a QT (Quit) command.

The following table explains the special effects that the CL command can have on certain kinds of units. In general, all queued I/Os are marked as canceled.

Device

Effect

LP

Clears the FORMID for the unit or terminates the tasks that are using that unit. The system does not clear the FORMID for the unit when the unit is in use and you enter the CL command.

MT

Causes the tape to rewind and the label to be reread. This is a handy way to sometimes resolve an unwanted UNLABELED PER MT indication. If an I/O is outstanding such as at the drive or in the tape controller the physical I/O subsystem waits for the I/O to complete. In some cases, this wait can last for several minutes before the CL MT command actually takes effect.

NP

Discontinues the associated NP/CONTROLLER/nnn stack and disconnects any associated BNA V2 stations. This process happens only if the NP is already in a saved state.

PK

All queued disk I/O operations are returned with a canceled result descriptor. Therefore, any program that uses direct I/O can handle an exception result descriptor by including the appropriate code. All subsequent I/O operations are canceled until the disk pack is closed by the command CLOSE PK<unit number>. Otherwise, data could be corrupted if some I/O operations were allowed to resume after other I/O operations were canceled. In this state, the pack is shown as BLASTED in the response to the PER PK command. To close a disk pack you must close all open files. The disk pack can then be readied back onto the system. If the ready action is successful, access to the unit is allowed.