Safekipedia

DIGITAL Command Language

Adapted from Wikipedia ยท Adventurer experience

A screenshot showing DCL commands running on the OpenVMS operating system.

DIGITAL Command Language (DCL) is the standard command language used in many operating systems made by Digital Equipment Corporation. It was first created for IAS and later used in RSX-11M, RT-11, and RSTS/E, but became most powerful in VAX/VMS, now known as OpenVMS. DCL is still being developed today by VSI as part of OpenVMS.

DCL is a scripting language that works with different kinds of data, such as words, whole numbers, groups of bits, lists, and true/false values. However, it does not work with numbers that have parts after the decimal point. DCL lets scripts ask the system for information and perform tasks similarly to programs written in other languages. It includes choices like "if this, then do that," and can work with many types of files.

DCL is not only for OpenVMS; it is also available for other operating systems. Versions like VCL and VX/DCL work on Unix, VCL works on MS-DOS, OS/2, and Windows, and PC-DCL and Open DCL work on Windows and Linux. There is also Accelr8 DCL Lite for Windows. DCL served as the foundation for the XLNT language, which runs on Windows using a special combination of tools and has been available since 1997.

Command-line parser

For OpenVMS, the command line parser is a special library that can be added to programs. This helps make commands work the same way for both system commands and ones you create.

Commands start with a word (called a verb) and can have up to 8 extra pieces of information (called parameters) or special settings (called qualifiers). These qualifiers start with a "/" and can appear anywhere in the command.

DCL commands do not need to be typed in all capital letters and can be shortened as long as they are clear. Commands need to be set up before you can use them, either by special files or by linking them directly to programs. Newer versions of OpenVMS also let you set up groups of folders where commands can be found, making it easier to run programs from different places.

Scripting

DCL scripts work like other computer languages, but they have special rules. Every command starts with a $ symbol. The rest of the line is the information for that command.

For example, to show words on the screen using the TYPE command, you might write:

$ TYPE SYS$INPUT: This is an example of using the TYPE verb in the DCL language. $ EXIT

Indirect variable referencing

In DCL, you can make arrays that use symbols to point to their parts. This helps programmers build big groups of data by using the data to organize itself.

For example, you can set up variables like this:

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

Here, the variable rainbowblue gets the value "red", and rainbowgreen gets the value "yellow".

Commands

Here are some common commands you can use in DCL for everyday computer tasks. These commands work with the OpenVMS command-line interface.

The commands include:

Lexical functions

Lexical functions help you work with text and get information that the system keeps track of.

Some of these functions include:

  • F$EXTRACT(start,length,string) โ€” this helps pick out a piece of text from a longer piece.

  • F$CVTIME โ€” this gets details about the date and time. For example:

    YEST_DOW=F$EXTRACT(0,3,F$CVTIME(DATE_EXPR,,"WEEKDAY"))

  • F$ELEMENT(0," ",ABC_DEF) โ€” if ABC_DEF is "ABC DEF", this would return "ABC".

  • F$SEARCH โ€” this looks for a file and returns nothing if it cannot find it.

  • F$LOCATE(needle,haystack)

  • F$SetPRV("BYPASS,CMKRNL,ALTPRI") โ€” this is for getting special access rights.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on DIGITAL Command Language, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.