DIGITAL Command Language

Last updated
DIGITAL Command Language
Openvms-8.4-2L1-dcl.png
OpenVMS Alpha 8.4-2L1, showing the DCL CLI in a terminal session
Paradigm imperative
Designed by Digital Equipment Corporation [1]
Developer VMS Software Inc. (VSI) [2]
OS RSTS/E, RSX-11, RT-11, OpenVMS, VAXELN, MICA
Influenced
Windows PowerShell

DIGITAL Command Language (DCL) is the standard command language adopted by many of the operating systems created by Digital Equipment Corporation. DCL had its roots in IAS, TOPS-20, and RT-11 and was implemented as a standard across most of Digital's operating systems, notably RSX-11 and RSTS/E, but took its most powerful form in VAX/VMS (later OpenVMS). DCL continues to be developed by VSI as part of OpenVMS. [3]

Contents

Written when the programming language Fortran was in heavy use, DCL is a scripting language supporting several data types, including strings, integers, bit arrays, arrays and booleans, but not floating point numbers. Access to OpenVMS system services (kernel API) is through lexical functions, which perform the same as their compiled language counterparts and allow scripts to get information on system state. DCL includes IF-THEN-ELSE, access to all the Record Management Services (RMS) file types including stream, indexed, and sequential, but lacks a DO-WHILE or other looping construct, requiring users to make do with IF and GOTO-label statements instead.

DCL is available for other operating systems as well, including

DCL is the basis of the XLNT language, implemented on Windows by an interpreter-IDE-WSH engine combination with CGI capabilities distributed by Advanced System Concepts Inc. from 1997.

Command-line parser

For the OpenVMS implementation, the command line parser is a runtime library (CLI$) that can be compiled into user applications and therefore gives a consistent command line interface for both OS supplied commands and user written commands. The command line must start with a verb and is then followed by up to 8 parameters (arguments) and/or qualifiers (switches in Unix terminology) which begin with a '/' character. Unlike Unix (but similar to DOS), a space is not required before the '/'. Qualifiers can be position independent (occurring anywhere on the command line) or position dependent, in which case the qualifier affects the parameter it appears after. Most qualifiers are position independent. Qualifiers may also be assigned values or a series of values. Only the first most significant part of the verb and qualifier name is required. Parameters can be integers or alphanumeric text.

An example OS command may look like:

set audit/alarm/enable=(authorization,breakin=all)showdevice/files$1$DGA1424:

The second show command could also be typed as:

sho dev $1$DGA1424:/fil

While DCL documentation usually shows all DCL commands in uppercase, DCL commands are case-insensitive and may be typed in upper-, lower-, or mixed-case.

Some implementations such as OpenVMS and RSX used a minimum uniqueness scheme in allowing commands to be shortened.

Unlike other systems which use paths for locating commands, DCL requires commands to be defined explicitly, either via CLD (Command Language Definition) definitions or a foreign symbol. Most OpenVMS-native commands are defined via CLD files; these are compiled by the CDU, the Command Definition Utility, and added to a DCL 'table' -- SYS$LIBRARY:DCLTABLES.EXE by default, although processes are free to use their own tables—and can then be invoked by the user. For example, defining a command FOO that accepts the option "/BAR" and is implemented by the image SYS$SYSEXE:FOO.EXE could be done with a CLD file similar to:

DEFINE VERB FOO    IMAGE "SYS$SYSEXE:FOO.EXE"    QUALIFIER BAR 

The user can then type "FOO", or "FOO/BAR", and the FOO program will be invoked. The command definition language supports many types of options, for example dates and file specifications, and allows a qualifier to change the image invoked—for example "CREATE", to create a file, vs. "CREATE/DIRECTORY" to create a directory.

The other (simpler, but less flexible) method to define commands is via foreign commands. This is more akin to the Unix method of invoking programs. By giving the command:

foo :== $sys$sysexe:foo.exe 

the command 'FOO' will invoke FOO.EXE, and supply any additional arguments literally to the program, for example, "foo -v". This method is generally used for programs ported from Unix and other non-native systems; for C programs using argc and argv command syntax.

Versions of OpenVMS DCL starting with V6.2 support the DCL$PATH logical name for establishing Unix-style command paths. This mechanism is known as an Automatic Foreign Command. DCL$PATH allows a list of directories to be specified, and these directories are then searched for DCL command procedures (command.COM) and then for executable images (command.EXE) with filenames that match the command that was input by the user. Like traditional foreign commands, automatic foreign commands also allow Unix-style command input.

Scripting

DCL scripts look much like any other scripting language, with some exceptions. All DCL verbs in a script are preceded with a $ symbol; other lines are considered to be input to the previous command. For example, to use the TYPE command to print a paragraph onto the screen, one might use a script similar to:

$ TYPESYS$INPUT: This is an example of using the TYPE verbin the DCL language.$ EXIT 

Indirect variable referencing

It is possible to build arrays in DCL that are referenced through translated symbols. This allows the programmer to build arbitrarily sized data structures using the data itself as an indexing function.

$ i=1$ variable'i'="blue"$ i=2$ variable'i'="green"$ j=1$ color=variable'j'$ rainbow'color'="red"$ color=variable'i'$ rainbow'color'="yellow"

In this example the variable rainbowblue is assigned the value "red", and rainbowgreen is assigned the value "yellow".

Commands

The following is a list of DCL commands for common computing tasks that are supported by the OpenVMS command-line interface. [2]

Lexical functions

Lexical functions provide string functions and access to VMS-maintained data.

Some Lexicals are:

See also

Related Research Articles

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

<span class="mw-page-title-main">OpenVMS</span> Computer operating system

OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using OpenVMS include banks and financial services, hospitals and healthcare, telecommunications operators, network information services, and industrial manufacturers. During the 1990s and 2000s, there were approximately half a million VMS systems in operation worldwide.

AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file redirection.

at (command) Task scheduling command on various operating systems

In computing, at is a command in Unix-like operating systems, Microsoft Windows, and ReactOS used to schedule commands to be executed once, at a particular time in the future.

In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin), standard output (stdout) and standard error (stderr). Originally I/O happened via a physically connected system console, but standard streams abstract this. When a command is executed via an interactive shell, the streams are typically connected to the text terminal on which the shell is running, but can be changed with redirection or a pipeline. More generally, a child process inherits the standard streams of its parent process.

<span class="mw-page-title-main">RSTS/E</span> Computer operating system

RSTS is a multi-user time-sharing operating system developed by Digital Equipment Corporation for the PDP-11 series of 16-bit minicomputers. The first version of RSTS was implemented in 1970 by DEC software engineers that developed the TSS-8 time-sharing operating system for the PDP-8. The last version of RSTS was released in September 1992. RSTS-11 and RSTS/E are usually referred to just as "RSTS" and this article will generally use the shorter form. RSTS-11 supports the BASIC programming language, an extended version called BASIC-PLUS, developed under contract by Evans Griffiths & Hart of Boston. Starting with RSTS/E version 5B, DEC added support for additional programming languages by emulating the execution environment of the RT-11 and RSX-11 operating systems.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

The Control Language (CL) is a scripting language originally created by IBM for the System/38 Control Program Facility and later used in OS/400. It bears a resemblance to the IBM Job Control Language and consists of a set of command objects (*CMD) used to invoke traditional programs or get help on what those programs do. CL can also be used to create CL programs where there are additional commands that provide program-like functionality

xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

Files-11 is the file system used in the RSX-11 and OpenVMS operating systems from Digital Equipment Corporation. It supports record-oriented I/O, remote network access, and file versioning. The original ODS-1 layer is a flat file system; the ODS-2 version is a hierarchical file system, with support for access control lists,.

In computer programming, a one-liner program originally was textual input to the command line of an operating system shell that performed some function in just one line of input. In the present day, a one-liner can be

Command-line completion is a common feature of command-line interpreters, in which the program automatically fills in partially typed commands.

VSI BASIC for OpenVMS is the latest name for a dialect of the BASIC programming language created by Digital Equipment Corporation (DEC) and now owned by VMS Software Incorporated (VSI). It was originally developed as BASIC-PLUS in the 1970s for the RSTS-11 operating system on the PDP-11 minicomputer. It was later ported to OpenVMS, first on VAX, then Alpha, and most recently Integrity.

<span class="mw-page-title-main">Comparison of command shells</span>

A command shell is a command-line interface to interact with and manipulate a computer's operating system.

In computing, a temporary folder or temporary directory is a directory used to hold temporary files. Many operating systems and some software automatically delete the contents of this directory at bootup or at regular intervals, leaving the directory itself intact.

A filter is a computer program or subroutine to process a stream, producing another stream. While a single filter can be used individually, they are frequently strung together to form a pipeline.

In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark at the beginning of a script. It is also called sharp-exclamation, sha-bang, hashbang, pound-bang, or hash-pling.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as a user-friendly alternative to punched cards.

References

  1. "VAX/VMS Software Language and Tools Handbook" (PDF). bitsavers.org. 1985. Retrieved 2020-12-31.
  2. 1 2 "VSI OpenVMS User's Manual" (PDF). VSI. July 2020. Retrieved 2021-01-27.
  3. "Software Product Description and QuickSpecs - VSI OpenVMS Version 8.4-2L1 for Integrity servers" (PDF). VMS Software Inc. July 2019. Retrieved 2021-01-02.
  4. "MichelValentin/PC-DCL". GitHub . 29 May 2022.
  5. "Comparison of PC-DCL vs. Open DCL Lite". A comparison of Valentin's PC-DCL vs. Accelr8 Open DCL Lite

Further reading