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.
For the OpenVMS implementation, the command line parser is a runtime library 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 arguments or qualifiers which begin with a '/' character. Unlike Unix, a space is not required before the '/'. Qualifiers can be position independent or position dependent, in which case the qualifier affects the parameter it appears after. Most qualifiers are position independent. Only the first most significant part of the verb and qualifier name is required. An example OS command may look like: set audit /alarm /enable= 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 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.EXEby 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 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$PATHlogical 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 and then for executable images 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: $ TYPE SYS$INPUT: This is an example of using the TYPE verb in 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".