DETACH

CMS Commands

detach.helpcmd.txt
DETACH                                                   CP Privilege Class:  G

Use the DETACH command to remove a virtual device from the virtual machine.
The format of the DETACH command is:
+----------+------------------------------------------------------------------+
| DETACH   | vaddr|CHANnel c                                                  |
+----------+------------------------------------------------------------------+
where:

vaddr     is the virtual address (cuu) of the device to be detached from your
          virtual machine.

CHANnel c is the real address of the channel that is to be detached.


Usage notes:

1.  You can detach a previously attached device even if the device is currently
    in use.  You can also detach devices that were attached because of VM/370
    directory entries or during CP system initialization.

2.  When you detach a virtual device, it becomes inaccessible to your virtual
    machine.  If the device was previously attached to your virtual machine by
    an ATTACH command, it is released and becomes available for attachment to
    your virtual machine, another user, or the CP system.  Tape devices are
    automatically rewound and unloaded when detached.

3.  If you detach a device that was previously attached to your virtual machine
    by the operator, a message is sent to the operator informing him that the
    device is free.

4.  If the device being detached is a dedicated 2305, the virtual address you
    specify must be a base address (xx0 or xx8).

5.  If DETACH CHANNEL is invoked prior to the normal completion of I/O
    activities on the dedicated channel, those activities are aborted.

Responses:

The DETACH command belongs to both the B and the G privilege class of user; the
response or responses issued are dependent upon who issues the DETACH command.
Depending upon the situation, responses are issued to:
o   The general user whose virtual machine has the device to be detached.
o   The system operator informing him that the device is successfully detached.
o   Another B privilege class operator (not the system operator) that may have
    initiated the detach operation.

type vaddr DETACHED
   The user receives one or more of these responses upon the completion of a
   successful detach operation that was self-initiated.

type vaddr DETACHED BY operator
   The user receives one or more of these responses upon the completion of the
   detach operation if the system operator or another user with the B privilege
   class had initiated the detach operation.

type vaddr DETACHED [userid ¦ SYSTEM]
   This is the response sent to the operator if you detach a previously
   attached device, or if the operator detaches it from a user or the system.

type vaddr DETACHED [userid ¦ SYSTEM] BY operator
   This is the response sent to the primary system operator if he did not issue
   the DETACH command and the device had been previously attached.

CTCA vaddr DROP FROM userid vaddr
   This is the response if the device detached was a virtual channel-to-channel
   adapter connected (via the COUPLE command) to another CTCA on the virtual
   machine specified by the userid.  This response is always followed by the
   response:
      CTCA vaddr DETACHED
   unless the SET IMSG OFF command was issued.

CHANNEL c DETACHED userid
   This response is sent to the user who issued the command, as well as to the
   primary system operator.

In the above responses, 'type' is one of the following:
   DASD      Direct access storage device/3330V (virtual) volumes
   TAPE      Magnetic tape
   LINE      Communication line
   RDR       Card reader
   PRT       Line printer
   PUN       Card punch
   GRAF      Graphics device
   CONS      Console
   CTC       Channel-to-channel device
   DEV       Any other device
   MSC       Mass Storage Control unit