Digital Command Language

DCL, the DIGITAL Command Language, is the standard command language of the OpenVMS operating system, which was originally by Digital Equipment Corporation ( DEC short ) was developed. Currently OpenVMS is developed and marketed by Hewlett- Packard ( HP short ).

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

  • 3.1 LOGIN.COM
  • 3.2 rowid
  • 3.3 Indirect referencing of variables
  • 3.4 Lexical features

Properties of DCL

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

The following points are for DCL.

  • DCL is available on any OpenVMS system.
  • DCL command procedures can be developed quickly. The programmer does not undergo editing / compile / link / test cycles, since DCL is an interpreted language.
  • DCL procedures can be quickly adapted, modified or expanded as needed.
  • DCL procedures can ( engl. utilities) use OpenVMS tools and other software products easily.
  • Some complex aspects of programming for OpenVMS can be significantly simplified by DCL, such as handling errors and interrupts ( insofar as such processing is relatively straightforward ).
  • Less experienced programmers can use to create individual blocks of a broader programming separately DCL procedures.

The following points are some of the limits of DCL.

  • A DCL procedure runs more slowly than a conventional compiled program as a DCL command procedure is executed by an interpreter. This comes into play especially when the DCL procedure computationally very intensive commands performs (eg very many arithmetic operations). It comes less into play when the procedure eg mainly performs file operations.
  • DCL missing some important arithmetic functions, such as support for floating point numbers.
  • Skills and ways of structuring data that are important for many software algorithms that are as good as non-existent in DCL.
  • DCL lacks some modern programming constructs such as WHILE or FOR loops. This has to be replicated manually in DCL.
  • Only simple user interface can be realized in DCL. DCL has no support for window techniques or other graphic representations.
  • A program can be invoked from a DCL procedure only if it provides a command interface (English command interface), ie Can not be used directly by code libraries from DCL.
  • The flexibility of DCL may make difficult to create a procedure that allows a less-privileged user to use selected features, to which the user is not authorized to directly (English captive command procedures ). For example, the INQUIRE command not only accepts input, but can also lead to execution of lexical functions (English lexical functions) are used.

As DCL was designed in the 1970s, the further development and use for the creation of complex tasks could be not necessarily foreseen, so that DCL in some respects not structured like the way other modern programming languages ​​appear.

Specialties of DCL

DCL has some special features compared to other command languages.

Foreign Commands

In DCL, it is possible ( and common), so-called external commands (german foreign commands ) to be defined. Through this mechanism, users can, for example, in their login procedure, define your own commands or modified standard commands.

$ Foo == $ sys $ sysexe: foo.exe By this definition, the new command FOO will call the program called FOO.EXE. This can be passed with optional parameters to the program.

$ ST == " SHOW TIME" Here the new command ST is defined, which is followed by a summary of the command to display the time.

$ Del * ete: == delete / confirm / log Here, the standard command DELETE is a foreign command so extended that by default, the options for logging with inquiries and are indicated. The star in the definition governs the position from which the command may also be used in an abbreviated form.

Logical Names

A logical name (English logicalName ) is a named entity that created and can be assigned a value. This name (or shortly called Logical ) is then subsequently 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 like a symbol, however, the two concepts differ in important ways. Logical names are stored in corresponding tables (English 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, logical name - as opposed to symbols - of several processes (ie, cross-process ) can be used. In a VMS cluster logical names can exist even across computer boundaries.

Creating command procedures

Creating command procedures in DCL is effected by means of a text editor that can be invoked directly from the DCL prompt.

The file extension for a DCL file is com -. These extension under OpenVMS is not to be confused with the homonymous extension under DOS / Windows, which has a different meaning.

LOGIN.COM

Usually, a special procedure for the login of a user is performed automatically. This procedure usually carries the name LOGIN.COM - this can be per user by the system administrator (possibly with a different name ) specified. This DCL procedure important features and commands can be defined either by the user or by the system administrator, which are important for the user's session.

Row identifier

Script (or command procedures ) in DCL scripts are similar in other languages ​​, but with some exceptions. All DCL commands in a command procedure must begin with a $ character. Other lines are interpreted as input to a command. ( Even lines that begin with THEN or ELSE, require the $ sign ).

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

$ TYPE SYS $ INPUT: This is an example of the TYPE command in DCL. $ EXIT Indirect referencing of variables

It is quite possible to replicate in DCL array. The individual elements of an array are referenced by translated symbols. This technique allows the programmer to create data structures in dynamic size, if necessary use the data itself as an index.

$ I = 1   $ Variable'i '= "blue"   $ I = 2   $ Variable'i '= " green "   $ J = 1   $ Color = variable'j '   $ Regenbogen'farbe '= ' red '   $ Color = variable'i '   $ Regenbogen'farbe '= ' yellow ' In this example, the variable is assigned "red" rainbow blue, the value of the variable rainbow green value of "yellow".

Lexical features

By means of lexical functions (English lexical functions) DCL it is possible to obtain system information (such as through your own process or through a Device (German unit) ) and extended string manipulations perform. All lexical functions begin with f $.

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

225228
de