DIGITAL Command Language
| Industry | Computer hardware and software |
|---|---|
| Founded | 1957 |
| Founder | Ken Olsen, Harlan Anderson |
| Fate | Acquired by Compaq in 1998 |
| Successor | Compaq, later Hewlett-Packard (HP) |
| Headquarters | Maynard, Massachusetts , United States |
DIGITAL Command Language (DCL) is the primary command language utilized across numerous operating systems created by Digital Equipment Corporation. Originally developed for the IAS under the name Program Development System (PDS), it was subsequently incorporated into RSX-11M, RT-11, and RSTS/E, ultimately evolving to its most sophisticated iteration within VAX/VMS (currently known as OpenVMS). Ongoing development of DCL is maintained by VMS Software Inc. (VSI) as an integral component of OpenVMS.
As a scripting language, DCL supports several data types including strings, integers, bit arrays, arrays, and Booleans; however, it does not accommodate floating point numbers. It grants access to OpenVMS system services (kernel API) through lexical functions that operate with performance comparable to compiled code, allowing scripts to retrieve system information. The language incorporates IF-THEN-ELSE control flow and manages all forms of Record Management Services (RMS) files—whether stream, indexed, or sequential. Notably, it lacks native looping constructs such as DO-WHILE, necessitating the use of IF combined with GOTO for iteration.
DCL is also supported on various other platforms:
- VCL and VX/DCL for Unix,
- VCL for MS-DOS, OS/2, and Windows,
- PC-DCL and Open DCL compatible with Windows/Linux,
- Accelr8 DCL Lite tailored for Windows environments.
Furthermore, DCL underpins the XLNT language, which runs on Windows through an interpreter-IDE-WSH engine featuring CGI integration, distributed by Advanced System Concepts Inc. since 1997.
Command-line parser
Within OpenVMS, the command line parser exists as a runtime library () that developers can embed into their software, establishing a uniform interface for both built-in and user-defined commands. Each command begins with a verb followed by up to eight parameters and/or qualifiers (also called switches) denoted by a leading '/'. Unlike Unix conventions, spaces preceding '/' characters are unnecessary. Qualifiers may be position-dependent or independent and can accept single values or lists. Only the initial segment of verbs and qualifiers must be distinct to ensure uniqueness. Parameters accommodate either integer values or alphanumeric strings.
Sample commands include: <syntaxhighlight lang="powershell"> set audit /alarm /enable=(authorization, breakin=all) show device /files $1$DGA1424: </syntaxhighlight> The show command can be abbreviated as:
sho dev $1$DGA1424:/fil
DCL commands are case-insensitive and may be entered in any letter case. Both OpenVMS and RSX implement minimum uniqueness rules for command abbreviation.
Unlike Unix-like systems that rely on paths, DCL mandates explicit command declarations via CLD (Command Language Definition) files or foreign symbols. Native commands are specified through CLD files compiled with the Command Definition Utility (CDU) into DCL tables (default: ), which can be tailored per process context. For instance, defining a command FOO with a "/BAR" option that executes : <syntaxhighlight lang="text"> DEFINE VERB FOO
IMAGE "SYS$SYSEXE:FOO.EXE" QUALIFIER BAR
</syntaxhighlight> Users execute "" or "" to launch the application. CLD supports various qualifier types including dates and file specifications, along with qualifier-based image substitutions (e.g., switching between "" and "").
Foreign commands provide a simpler mechanism akin to Unix command invocation by associating a command name directly with an executable: <syntaxhighlight lang="text"> foo :== $sys$sysexe:foo.exe </syntaxhighlight> This approach forwards arguments verbatim (such as ""), commonly applied when porting Unix or C programs that depend on argc/argv conventions.
Beginning with OpenVMS version 6.2, the logical name feature facilitates Unix-style command path resolution through Automatic Foreign Commands. This method searches designated directories for matching DCL procedures (.COM) or executables (.EXE), enabling support for both traditional foreign commands and Unix-like command input behavior.
Scripting
DCL scripts are similar to conventional scripting languages but require each DCL verb to be prefixed with a $ character; lines following these verbs act as input for the preceding command. For instance, to print a paragraph, the TYPE command is utilized as shown below: <syntaxhighlight lang="console"> $ TYPE SYS$INPUT: This example demonstrates usage of the TYPE verb within the DCL scripting language. $ EXIT </syntaxhighlight>
Indirect variable referencing
DCL facilitates the creation of arrays through translated symbols, allowing for dynamic data structures indexed by variable content. Consider this example: <syntaxhighlight lang="console"> $ i = 1 $ variable'i' = "blue" $ i = 2 $ variable'i' = "green" $ j = 1 $ color = variable'j' $ rainbow'color' = "red" $ color = variable'i' $ rainbow'color' = "yellow" </syntaxhighlight> In this case, the variables are assigned the values "red" and "yellow" respectively.
Commands
Essential DCL commands commonly used in OpenVMS environments include:
Lexical functions
Lexical functions provide capabilities for string handling and accessing system information on VMS, such as:
- — extracts a portion of a string
- — obtains date and time details, including day of the week
- — returns the first item from a list of strings
- — locates files, returning null if none found
- — manages system privilege settings