CLOSE

CMS Commands

close.helpcmd.txt
CLOSE                                                    CP Privilege Class:  G

Use the CLOSE command to terminate the spooling activity on any virtual spooled
unit record or console device.  The format of the CLOSE command is:
+----------+------------------------------------------------------------------+
| CLOSE    | Reader|vaddr [HOLD|NOHOLD]                                       |
|          |                                                                  |
|          | CONsole|Printer|PUnch|vaddr [operands]                           |
|          |                                                                  |
|          | operands:                                                        |
|          |    PUrge    HOld|NOHold    DIst distcode    Name dsname|fn [ft]  |
+----------+------------------------------------------------------------------+
where:

Reader | RDR
         closes all reader spool files.

CONsole  closes your virtual machine's console spool file.  Once a virtual
         console spool file is closed, it becomes a printer spool file and can
         be manipulated in the same way as any printer spool file (for example,
         it can be purged or changed).

Printer | PRT
         closes all printer spool files.

PUnch | PCH
         closes all punch spool files.

vaddr    is the virtual address (cuu) of the device to be closed.  The address
         may represent a reader, console, printer, or punch.

HOld     makes the output spool file being closed unavailable for further
         processing, until it is specifically requested or changed.  However,
         input reader files are still available for processing (see Usage Note
         5).  This option, specified in the CLOSE command, overrides any
         previously specified HOLD or NOHOLD option for the files being closed.

NOHold   makes the output spool file being closed available for further
         processing, but the input reader file is no longer available for
         processing (see Usage Note 5).  Specify NOHOLD if a HOLD established
         by the SPOOL command is still in effect and the current active file is
         not to be held.

         You can release one of your own output files in HOLD status by using
         the CHANGE command.  If an output file is spooled for another user
         (SPOOL FOR userid), only the receiving virtual machine user can change
         the file status.  If an output file is spooled to another user as an
         input file (SPOOL TO userid), the HOLD option places the input file in
         HOLD status.  The file then cannot be read by the virtual machine
         until it is changed to NOHOLD by the receiving virtual machine user.

         If an input file is closed with the HOLD option, the file is saved and
         not purged from the system.  The saved file is available for virtual
         machine and user processing and is not placed in a user hold status.
         Input spool files that are closed are normally purged from the virtual
         machine.

PUrge    closes and immediately purges from the virtual machine the output
         spool files.  No output file is produced.

DIst distcode
         uses the 1- to 8-character alphameric identification (distcode) on the
         output separators of printer and punch instead of the identification
         specified in the VM/370 directory.  The distribution code is changed
         for this file only and does not affect other files or change the
         VM/370 directory.  If the file is transferred to another user, this
         option has no effect.

NAme fn [ft]
         assigns identification to the spool file in the CMS format filename
         and filetype.  The filename, fn, is a 1- to 8-character alphameric
         name assigned to the file for identification.  The filetype, ft, is a
         1- to 8-character alphameric type assigned to the file for
         identification.  If ft is not specified, the filetype is set to
         blanks.

NAme dsname
         assigns identification to the spool file in a non-CMS format.  The
         dsname field is a 1- to 24-character field suitable for specifying OS
         or DOS files (for example, SYS1.SYSLIB.MYMAC).  Only 18 characters of
         the 24-character dsname are displayed by QUERY, even though a name of
         up to 24 characters is valid.


Usage Notes:

1.  If the file is an input reader file, the file being processed is purged
    unless SPOOL READER HOLD was previously specified (see the SPOOL command).
    The effect of HOLD or NOHOLD for a particular file established by the SPOOL
    command can be overridden by specifying NOHOLD or HOLD, respectively, in
    the CLOSE command.

2.  If an input spool file is read but the read is not completed (that is, the
    virtual machine does not get a last-card indication), you must issue a
    CLOSE READER command in order to be able to read that file again (or to
    read any other file).  Unless you specify HOLD when you close a reader
    file, the file is purged.

3.  If the file is an output file on a printer, punch, or console, the file is
    either queued for output on a real unit record device, or, if the virtual
    output device is transferred (by use of the "SPOOL vaddr TO userid"
    command), the file is queued for input to the receiving user.

4.  You can specify a filename and filetype and an optional distribution code
    to aid in later identification of the file and its contents.

5.  The following table shows what happens to an input file in your virtual
    reader when the CLOSE command is issued with the HOLD or NOHOLD operand in
    effect.  The CLOSE command can result in an input file being purged or
    saved.
    +-------------+-----------------------------------------------------------+
    ¦Virtual Dev  ¦ SPOOL Command Options Set for a Virtual Input Device      ¦
    ¦Status       +--------------+--------------+--------------+--------------+
    ¦(CLOSE cmd   ¦ NOHOLD       ¦ HOLD         ¦ NOHOLD       ¦ HOLD         ¦
    ¦setting)     ¦ NOCONT       ¦ NOCONT       ¦ CONT         ¦ CONT         ¦
    +-------------+--------------+--------------+--------------+--------------+
    ¦Normal EOF:  ¦File released ¦File saved    ¦File released ¦File held     ¦
    ¦default CLOSE¦for processing¦              ¦for processing¦              ¦
    +-------------+--------------+--------------+--------------+--------------+
    ¦ CLOSE       ¦File released ¦File saved    ¦File released ¦File held     ¦
    ¦             ¦for processing¦              ¦for processing¦              ¦
    +-------------+--------------+--------------+--------------+--------------+
    ¦ CLOSE HOLD  ¦File saved    ¦File saved    ¦File saved    ¦File saved    ¦
    +-------------+--------------+--------------+--------------+--------------+
    ¦ CLOSE       ¦File released ¦File released ¦File released ¦File released ¦
    ¦ NOHOLD      ¦for processing¦for processing¦for processing¦for processing¦
    +-------------+--------------+--------------+--------------+--------------+
    Note: The term "saved" means that the file is neither purged nor is it in
    HOLD status.  A subsequent READ could read this file.

Responses:

PRT¦PUN¦CON FILE spoolid FOR¦TO userid COPY nnn HOLD¦NOHOLD
   This response is received if: multiple copies of the file are being
   processed, the file is being transferred to another user, or the file is
   placed in a USER HOLD status.  However, if the SET IMSG option is OFF, this
   message is not issued even though the preceding conditions are met.