240 likes | 1.03k Views
DCL - Digital Command Language. Matthias Schmitt www.tecmumas.de 2007-04-21. 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).
E N D
DCL - Digital Command Language Matthias Schmitt www.tecmumas.de 2007-04-21
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
Command Procedures 1 • Command procedures can be run in interactive or in batch mode • interactive mode: $ @commandproc.com • batch mode: $ submit commandproc.com • All lines start with the dollar (“$”) sign. • Comments are marked with an “!” (c) 2007 Matthias Schmitt / www.tecmumas.de
Command Procedures 2 • Program flow • GOSUB .... RETURN • GOTO • IF ... THEN ... ELSE ... ENDIF • Subroutines • CALL • SUBROUTINE ... ENDSUBROUTINE (c) 2007 Matthias Schmitt / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
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 / www.tecmumas.de
Further Literature • VMS User’s ManualOrder No. AA-LA98B-TEDigital Equipment Corporation 1989 • “Kurzübersicht über OpenVMS und DCL” (in German): www.tecmumas.de (c) 2007 Matthias Schmitt / www.tecmumas.de