Digital Command Language

from Wikipedia, the free encyclopedia

DCL , the DIGITAL Command Language , is the standard command language of the OpenVMS operating system , which was originally developed by the Digital Equipment Corporation (DEC for short). OpenVMS is currently being further developed and sold by Hewlett-Packard (HP for short). The first use was under the RSX-11 operating system .

With DCL, actions can be carried out at the command prompt , for example for file editing and processing (similar to MS-DOS ) or for system administration , but also complex command procedures that can be run interactively or in batch mode (see shell scripts under Unix ).

Properties of DCL

DCL allows the creation of complex command procedures and is therefore quite suitable for programming , but DCL as a command language also has its limits. Compared to conventional programming languages , DCL has advantages and disadvantages.

The following points count for DCL.

  • DCL is available on every OpenVMS system.
  • DCL command procedures can be developed quickly. The programmer does not have to go through any edit / compile / link / test cycles since DCL is an interpreted language.
  • DCL procedures can be quickly adapted, changed or expanded as required.
  • DCL procedures can easily use OpenVMS tools (utilities) and other software products.
  • Some complex aspects of programming for OpenVMS are significantly simplified by DCL, such as: B. the handling of errors and interrupts (as long as the processing remains relatively uncomplicated).
  • Less experienced programmers can use DCL procedures to create individual blocks of more extensive programming separately.

The following are some of the limits of DCL.

  • A DCL procedure is processed more slowly than a conventional, compiled program because a DCL command procedure is executed by an interpreter . This is particularly important when the DCL procedure carries out very computationally intensive commands (e.g. a large number of arithmetic operations). It is less important if the procedure is carried out e.g. B. mainly performs file operations.
  • DCL lacks some important arithmetic functions, such as: B. the support of floating point numbers .
  • Skills and possibilities for structuring data, which are important for many software algorithms , are as good as nonexistent in DCL.
  • DCL lacks some of the constructs of modern programming, such as WHILE or FOR loops. These must be modeled manually in DCL.
  • Only simple user interfaces can be implemented in DCL. DCL has no support for windowing techniques or other graphic representations.
  • A program can only be called by a DCL procedure if it provides a command interface, i.e. H. Code libraries cannot be used directly from DCL.
  • The flexibility of DCL can make it difficult to create a procedure that allows a less privileged user to use selected functions for which the user is not directly authorized (captive command procedures). For example, the INQUIRE command not only accepts input, but can also be used to execute lexical functions.

When DCL was conceived in the 1970s, further development and use for the creation of complex tasks could not necessarily be foreseen, so that in some points DCL may not appear as structured as other more modern programming languages.

Specialties from DCL

DCL has some special features compared to other command languages.

Foreign Commands

In DCL it is possible (and usual) to define so-called foreign commands. This mechanism allows users, e.g. B. Define your own commands or modified standard commands in your login procedure.

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

After this definition, the new command FOOwill call the program called FOO.EXE. Optionally, parameters can also be transferred to the program.

$ ST == "SHOW TIME"

The new command is STdefined here, which is then a short version of the command for displaying the time.

$ del*ete:==delete /confirm/log

Here the standard command is extended DELETEas a foreign command in such a way that the options for querying and logging are also specified by default. The asterisk in the definition determines the position from which the command can also be used in abbreviated form.

Logical Names

A logical name is a named entity that can be created and assigned a value. This name (also called Logical for short ) then stands for this value in a context such as a file specification. Within this context, OpenVMS automatically replaces the logical name with its value. A logical name is similar to a symbol, but the two concepts differ in important ways. Logical names are stored in appropriate tables (logical name tables). These tables can be made available at different levels: a single process, a family of processes, or all processes in the system. Therefore, as opposed to symbols, logical names can be used by multiple processes (i.e. across processes). In a VMS cluster, logical names can even exist across computer boundaries.

Creation of command procedures

Command procedures are created in DCL using a text editor that can be called directly from the DCL prompt.

The file extension for a DCL file is .com - this extension under OpenVMS should not be confused with the extension of the same name under DOS / Windows, which has a different meaning.

LOGIN.COM

Usually, a special procedure for which to login a user automatically executed. This procedure is usually called LOGIN.COM - this can be specified for each user by the system administrator (if necessary with a different name). In this DCL procedure, either the user himself or the system administrator can define important properties and commands that are important for the user's session.

Line identifier

Scripts (or command procedures) in DCL are similar to scripts in other languages, with a few exceptions. All DCL commands in a command procedure must begin with a $ sign. Other lines are interpreted as input for a command. (Even lines beginning with THEN or ELSE require the $ sign).

The following example demonstrates the use of the TYPE command to display a section on the screen.

$ TYPE SYS$INPUT:
Dies ist ein Beispiel für das
TYPE-Kommando in DCL.
$ EXIT

Indirect referencing of variables

It is entirely possible to recreate arrays in DCL. The individual elements of an array are referenced by translated symbols. This technique allows the programmer to create dynamic size data structures that may use the data itself as an index.

$ i = 1
$ variable'i' = "blau"
$ i = 2
$ variable'i' = "gruen"
$ j = 1
$ farbe = variable'j'
$ regenbogen'farbe' = "rot"
$ farbe = variable'i'
$ regenbogen'farbe' = "gelb"

In this example, the regenbogenblauvalue "red" is assigned to the tag and regenbogengruenthe value "yellow" to the tag.

Lexical functions

Using lexical functions, it is possible for DCL to obtain system information (for example about its own process or about a device) and to carry out extended string manipulations. All lexical functions begin with f$.

$ write sys$output f$user()

This example will use the lexical function f$user()to output the name of the currently logged on user to the console.

literature

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

Web links