DCL - Digital Command Language Matthias Schmitt
(c) 2007 Matthias Schmitt / What is DCL? Command language for interactive tasks Programming language for scripts (a.k.a. command procedures) Part of the following DEC operating systems: –OpenVMS (VAX and Alpha) –RSX-11, RSTS, RT-11 (PDP-11)
(c) 2007 Matthias Schmitt / Origins of DCL DCL was developed in mid of 1960ies from the command languages for PDP-8, PDP-11, PDP-11 and PDP-15.
(c) 2007 Matthias Schmitt / Basics 1 DCL commands can be used in two different modes: –Interactive –Batch Command procedures (scripts) can be used in both modes
(c) 2007 Matthias Schmitt / Basics 2 The DCL command line consists of the following parts: [$] command [/qualifier[=value]...] [parameter [/qualifier...]] –$: Prompt –Qualifier: Modifies the action taken by the command. –Parameter: Specifies what the command acts upon. –Value: Modifies a qualifier.
(c) 2007 Matthias Schmitt / Basics 3 Example command line: $ edit /tpu file.txt –$: Prompt (Displayed by operating system) –edit: Command (starts the editor) –/tpu: Qualifier (use the Text Processing Utility) –file.txt: Parameter (name of file to edit)
(c) 2007 Matthias Schmitt / Basics 4 DCL is a user friendly command language. It uses English words as commands. For the convenience of the user, they can be abbreviated as soon as they are unambiguous: –$ directory /size /grand_total –$ dir /siz /g
(c) 2007 Matthias Schmitt / Commands List of basic interactive commands: –$ directory lists contents of directory –$ create creating of files, directories –$ type /page showing the contents of a text file –$ edit editing text files –$ logout terminating the interactive session
(c) 2007 Matthias Schmitt / Command Procedures 1 Command procedures can be run in interactive or in batch mode –interactive mode: –batch mode: $ submit commandproc.com All lines start with the dollar (“$”) sign. Comments are marked with an “!”
(c) 2007 Matthias Schmitt / Command Procedures 2 Program flow –GOSUB.... RETURN –GOTO –IF... THEN... ELSE... ENDIF Subroutines –CALL –SUBROUTINE... ENDSUBROUTINE
(c) 2007 Matthias Schmitt / Lexical Functions 1 Lexical functions provide –information about the current process –information about devices and the environment –powerful tools for manipulating strings
(c) 2007 Matthias Schmitt / Lexical Functions 2 Process information –F$DIRECTORY() returns the current directory –F$MODE() returns the mode (interactive, batch, network or other) –F$PID() returns the process ID –F$PROCESS() returns the process name
(c) 2007 Matthias Schmitt / Lexical Functions 3 Device and Environment information –F$GETDVI(device,item) returns information about the device –F$GETQUI(function,[item],[object],[flags]) returns information about queues, batch and print jobs etc. –F$GETSYI(item,[node]) returns information about the system (local or remote)
(c) 2007 Matthias Schmitt / Lexical Functions 4 String Manipulation –F$EDIT(string,commands) edit string –F$ELEMENT(no,del,string) extracts an element from a string of elements –F$EXTRACT(start,len,string) extracts parts –F$LENGTH(string) returns the length –F$LOCATE(part,string) searches within a string
(c) 2007 Matthias Schmitt / Example $! INIT_ERASE_TAPE.COM $ set noverify $ if "''p1'".eqs. "" then exit $ show time $ show device 'P1 $ init /erase 'P1 leer $ show device 'P1 $ show time $ mount 'P1 leer $ dismount /unload 'P1
(c) 2007 Matthias Schmitt / Further Literature VMS User’s Manual Order No. AA-LA98B-TE Digital Equipment Corporation 1989 “Kurzübersicht über OpenVMS und DCL” (in German):