World Library  
Flag as Inappropriate
Email this Article

DIGITAL Command Language

Article Id: WHEBN0000532369
Reproduction Date:

Title: DIGITAL Command Language  
Author: World Heritage Encyclopedia
Language: English
Subject: OpenVMS, List of programming languages by type, RSX-11, Spaghetti code, String literal
Collection: Command Shells, Openvms, Scripting Languages
Publisher: World Heritage Encyclopedia

DIGITAL Command Language

DIGITAL Command Language
Paradigm(s) imperative
Designed by Digital Equipment Corporation
Developer Digital Equipment Corporation
Influenced Windows PowerShell
OS RSX-11, OpenVMS

DCL, the DIGITAL Command Language, is the standard command language adopted by most of the operating systems that were sold by the former Digital Equipment Corporation (which has since been acquired by Compaq which itself was acquired by Hewlett-Packard). It had its roots in the IAS, TOPS-20, and RT-11 operating systems and was implemented as a standard across most of Digital's operating systems, notably RSX-11, but took its most powerful form in the OpenVMS operating system.

Written when the Fortran programming language was in heavy use, DCL is a scripting language supporting several datatypes, 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 RMS file types including stream, indexed, and sequential, but unfortunately lacks a DO-WHILE or other looping construct, requiring users to make do with IF and GOTO-label statements instead.


  • Command line parser 1
  • Scripting 2
  • Indirect variable referencing 3
  • See also 4
  • Literature 5
  • External links 6

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 operating system supplied commands and user written commands. The command line must start with a verb and is then followed by arguments and/or position independent qualifiers (switches in Unix terminology), which can occur anywhere on the command line, or position dependent qualifiers which affect the parameter they appear after. Most qualifiers are position independent; that is, they can appear anywhere in the command line. Only the first most significant part of the verb and qualifier name is required. An example operating system command may look like:

    set audit/alarm/enable=(authorization, breakin=all)
    show device/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) used a minimum uniqueness scheme in allowing commands to be shortened while others (such as RSX-11) allowed commands to be abbreviated to a minimum of three characters.

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 (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:


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.


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:

 This is an example of using the TYPE verb
 in the DCL language.

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".

See also


  • Paul C. Anagnostopoulos, Steve Hoffman: Writing Real Programs in DCL, Second Edition, 1998, Digital Press. ISBN 1-55558-191-9

External links

  • HP OpenVMS DCL Dictionary
  •'s DCL archive
  • Archive of DEC Professional/Digital Age magazine's DCL columns
  • XML-based new orientation for DCL and OpenVMS interface
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.