Previous Page | Next Page

Introduction to the OpenVMS Operating Environment

The OpenVMS Digital Command Language


Introduction to the OpenVMS Digital Command Language

When you communicate with the OpenVMS operating environment, you can use the OpenVMS Digital Command Language (DCL). Like other languages, DCL has grammar rules and a vocabulary. The vocabulary is a set of commands, and the grammar rules determine how you specify the commands.


The Command Line

A completely specified DCL command is called a command line. The general form of a command line is the following:

$ command/qualifier parameter/qualifier
dollar sign ($) prompt

is required in all DCL command lines. When you execute DCL commands interactively, the OpenVMS system supplies the system prompt, which by default is the $ prompt. When you enter DCL commands in a command file, such as LOGIN.COM, you must enter the $ prompt in column 1.

command

is a DCL command that identifies the action to be performed. Use OpenVMS DCL Dictionary as a general reference to DCL commands and rules of grammar. Some commonly used DCL commands are described in Commonly Used DCL Commands.

Some DCL commands are called verbs. These are commands whose names indicate the command's function.

qualifier

is an optional keyword that modifies or expands the action of the command. It is always preceded by a forward slash (/). If a qualifier requires a value, it is given in the following form:

qualifier=value
parameter

is either a keyword or a file specification (depending on the command) that is acted on by the command. For information about how to enter an OpenVMS file specification, see OpenVMS Filenames.

If the command requires one or more parameters, then OpenVMS prompts you for them, unless you include the parameter on the command line. Notice in the command line syntax that both commands and parameters can be qualified.


How to Continue a Long Command on the Next Line

If a command line does not fit on one line, enter a space and a hyphen (-) as the last element on the command line. Then, press the ENTER key and continue the command on the next line:

$ command -
_$ parameter/qualifier

When you end a command line with a hyphen, the next prompt is preceded by an underscore (_).


Interrupting Command Line Processing

You can interrupt command line processing by simultaneously pressing the CTRL key and the Y key (CTRL+Y).


Command Procedures

A command procedure is an OpenVMS file that contains sequences of DCL commands. The OpenVMS file type for command procedures is COM. The LOGIN.COM file is an example of a command procedure. (For more information, see LOGIN.COM File.) To save yourself time when you perform complicated or repetitive tasks, you can create command procedures.


Creating a Command Procedure

Use your favorite editor to create the file of commands. For example, the following series of commands might be included in a command procedure named RENAME.COM:

$ PURGE *.*
$ RENAME *.*; *.*;1

The first line deletes all but the latest version of all files in your default directory. The second line renames all files in your current directory to version 1.


Invoking a Command Procedure

To invoke the RENAME.COM command procedure, you would enter the following command at the $, or system, prompt:

$ @RENAME

The at sign (@) indicates that you want to execute a command procedure. For more information about creating and using command procedures, see OpenVMS User's Manual.


Commonly Used DCL Commands

Some of the most commonly used commands in an interactive command language are those that control your terminal session and those that manage files. The following subset of commands is divided into these two categories: controlling a terminal session and managing files. Many of these commands are used in examples throughout this documentation. The common abbreviation for a command is shown in parentheses beside the fully specified command. These abbreviations are the defaults; if these commands or symbols have been redefined, they might have a different action. See your system manager if the abbreviation does not work as you expected.

Note:   You can issue any DCL command from within a SAS program by specifying the command in the SAS X statement or X command. For more information, see Issuing DCL Commands during a SAS Session.  [cautionend]


Commands for Controlling a Terminal Session

Use the following DCL commands to control your terminal session:

DIRECTORY (DIR)

displays a list of files and subdirectories in the specified directory, or in the current directory if no directory or file specification is given. For example, the following command produces a list of files in your default directory:

$ DIR
HELP

activates the OpenVMS HELP facility.

LOGOUT (LO)

terminates a terminal session and deletes your process.

SET DEFAULT (SET DEF)

changes the default directory. If you move to another disk, this command also changes the default disk device. For more information about the default directory, see Directories.

SET DISPLAY (SET DISP)

indicates where to send the interactive display of an OpenVMS DECwindows application. You need to use this command when you are running interactive SAS on a nonlocal device such as a PC monitor running emulation software.

SHOW DEFAULT (SHO DEF)

displays the default directory and the default disk device.

SHOW QUEUE (SHO QUE)

displays all queues including the batch queue.

SUBMIT (SUBM)

places one or more jobs (command procedures) in a batch queue for processing.


Commands for Managing Files

Use the following DCL commands to manage your files:

COPY (COP)

copies one or more files to one or more specified files.

CREATE/DIRECTORY (CRE/DIR)

creates a directory.

DEFINE

associates a logical name with a file specification or equivalence name.

DELETE (DEL)

removes access to a file. The file specification must reference the version or versions.

EDIT</editor> (ED</editor>)

invokes the specified OpenVMS editor to create or modify a file.

PRINT (PR)

prints a file on the default system printer or on a specified device.

PURGE (PUR)

deletes all versions of a specified file or files except the latest version.

TYPE (TY)

displays the contents of a file.

Previous Page | Next Page | Top of Page