/******************************************************************/ /* Document : OpenVMS command examples */ /* Doc. Version : 6 */ /* File : vms.txt */ /* Purpose : an orientation on OpenVMS and DCL */ /* Date : 15-06-2010 */ /* Compiled By: : Albert van der Sel */ /* */ /******************************************************************/ Many examples in this document, can be replayed by using a free public accessible OpenVMS system, like: (1): "poetry.homelinux.org", using a telnet client (like Reflection or putty) with port 17023 Then you are able to logon to the OpenVMS Node "SNORRY" using account "LUTHER" (no password). Although restricted in permissions, for just looking around (e.g. "show" commands), it's really nice. (2): A public accessible VMS system is available at: "http://deathrow.vistech.net/webssh.shtml" here you can choose to start a "webssh" session to for example node "gein". logon with the account "DEMO" with password "USER". Although restricted in permissions, for just looking around (e.g. "show" commands), it's really nice. ======================================================= A few remarks on The Platform: ======================================================= VMS stand for "Virtual Memory System". This Operating System was designed for DEC VAX hardware. VAX stands for "Virtual Address eXtension", made by Digital Equipment Coorperation (or in short: DEC, or Digital). The various VAX models, ranged from smaller "workstation-like" machines, up to "mainframe-like" sizes. While they were quite popular in the '80's and '90's, you won't see very much DEC VAX hardware anymore. VMS existed before OpenVMS. But, OpenVMS is not too much different from VMS. Partly, the name change was done to reflect the Posix support in VMS, and also because VMS was ported for Alpha machines, and so it was renamed to OpenVMS. OpenVMS can run on VAX, Alpha machines, and Itanium. Although not so well-known as other Operating Systems, you can still find OpenVMS at many places where "downtime" is a very serious situation. Indeed, OpenVMS allows you to design systems with a very High Availability. Just as with a Unix host (or other host systems), you can use a terminal emulator on your PC (like Reflection or putty etc..), to connect to an OpenVMS system, using telnet or ssh. It's hardly any different from what you might know from logging on to Unix Hosts. Although you can use X Windowing systems (e.g. DCE), it's more likely that you will work on the "prompt" or "commandline" (just like often you do with Unix systems). OpenVMS offers a "shell" (or commandline) called DCL (Digital Command Language). Just like the korn shell, or bourne shell, or bash on Unix/Linux, DCL works quite the same way, although the commands and syntax are ofcourse quite specific for OpenVMS. But the same principle applies. And, I am quite sure that you will see a few familiar commands (like you use in MSDOS, or Windows cmd), like for example the "dir" command. After you have loggend on to the OpenVMS system (using your accountname and password), you typically will see the "$" prompt. But it's also possible that the system adminstrator has made the prompt somewhat more "informative", like showing the node name (hostname) as well as you account name. After logging in, your personal login file, called LOGIN.COM, is executed automatically. Then the prompt will appear. So, you might see a simple prompt like this: $ Or maybe somewhat more informative like this: SNORRY:LUTHER $ # meaning Host or Node "SNORRY" and account "LUTHER" Also note that VMS and OpenVMS are not case sensitive in the commands. So, a command like "SHOW PROCESS" is the same as "show process". Very typical of DCL commands, is that the main command usually has "options" and "suboptions". which you enter For example, take a look at the SHOW command. You can use it to "show" many different things, like $ SHOW USERS # lists the users on the system $ SHOW NETWORK # shows what network protocols are installed. But, most commands (like "SHOW PROCESS") has suboptions (called "qualifiers") as well. To use that, use the "/suboption" syntax. Examples: $ show process #list main properties of your process $ show process/all #detailed list of your process $ show process/id= #lists properties of process with id= The "system" account: Just like the superuser "root" on Unix systems, OpenVMS has it's sort of root account too. It's called "system", and if you logon with that account, you have "all power" on the system. Now let's go to some examples. ================================================================== 1. a few "SHOW" command examples to get aquinted with the system: ================================================================== Let's first take a look at some important "SHOW" commands, that will give you some "feeling" on what system you are working on (or in other words: a bit "exploring" the environment). 1.1 SHOW USERS: =============== In Unix, you can use the "who" command, to see who else is logged on to the Host. In VMS, you can do similar, using the "show users" command, like: SNORRY::LUTHER$ show users OpenVMS User Processes at 6-JUN-2010 19:19:35.56 Total number of users = 1, number of processes = 1 Username Interactive Subprocess Batch LUTHER 1 A more full syntax is: SHOW USER[/NODE=...][/FULL] [user_name] So, you can also obtain a list of users working on some specific Node. 1.2 The "SHOW CLUSTER" command: =============================== Whichever machine you log on to within the VMS cluster, you will be left in your own personal directory. A list of the VMScluster machines can be obtained by entering the SHOW CLUSTER command. SNORRY::LUTHER$ show cluster View of Cluster from system ID 1094 node: SNORRY 6-JUN-2010 19:43:02 +-----------------------------+ ¦ SYSTEMS ¦ MEMBERS ¦ +-------------------+---------¦ ¦ NODE ¦ SOFTWARE ¦ STATUS ¦ +--------+----------+---------¦ ¦ SNORRY ¦ VMS V7.2 ¦ ¦ +-----------------------------+ So, Node "snorry" is all alone here. But you could have seen a list of multiple nodes. 1.3 The "SHOW NETWORK" command: =============================== This will show you the network protocols in use, as well as addresses: SNORRY::LUTHER$ show network Product: DECNET Node: SNORRY Address(es): 1.70 Product: TCP/IP Node: snorrvijoier.poetry.org Address(es): 10.20.1.20 1.4 The "SHOW SYSTEM" command: =============================== If you want to view the processes on the system, use the "SHOW SYSTEM" command, like SNORRY::LUTHER$ show system OpenVMS V7.2 on node SNORRY 6-JUN-2010 20:46:50.94 Uptime 79 21:47:53 Pid Process Name State Pri I/O CPU Page flts Pages 00000101 SWAPPER HIB 16 0 0 00:00:02.11 0 0 00000104 LANACP HIB 13 40 0 00:00:00.39 329 844 00000106 IPCACP HIB 10 7 0 00:00:00.11 99 129 00000107 ERRFMT HIB 7 48613 0 00:03:27.57 146 221 00000109 OPCOM HIB 8 7109 0 00:00:14.71 1806 142 0000010A AUDIT_SERVER HIB 10 344 0 00:00:03.77 528 902 0000010B JOB_CONTROL HIB 10 4251 0 00:00:25.31 302 435 0000010C QUEUE_MANAGER HIB 9 223 0 00:00:01.76 704 1044 0000010D SECURITY_SERVER HIB 10 235 0 00:00:05.35 1496 1183 0000010E NETACP HIB 10 702 0 00:00:02.26 181 394 0000010F EVL HIB 6 58 0 00:00:00.44 398 590 N 00000110 REMACP HIB 8 33 0 00:00:00.08 112 74 00000111 TCPIP$INETACP HIB 9 1795 0 00:00:10.05 884 937 00000112 TCPIP$FTP_1 LEF 10 101 0 00:00:01.76 2064 805 N 00000113 LATACP HIB 14 10 0 00:03:22.85 300 259 00000114 CRONTAB_MANAGER LEF 6 345294 0 02:52:35.74 933 286 0000022B LUTHER CUR 4 486 0 00:00:05.58 7489 325 You can use the suboption /INT (interactive), /BAT (batch) and /NET (network) to pick out these types of processes. You can get more detail using SNORRY::LUTHER$ SHOW SYSTEM/FULL The following subptions, or qualifiers, can be used: Qualifiers /BATCH /CLUSTER /EXACT /FULL /HEADING /HIGHLIGHT /IDENT /INTERACTIVE /MULTITHREAD /NETWORK /NODE /OUTPUT /OWNER_UIC /PAGE /PROCESS /SEARCH /STATE /SUBPROCESS 1.5 The "SHOW STATUS" command: ============================== SHOW STATUS command: -------------------- If you want to display the current status of your process, you might use the "SHOW STATUS" command: SNORRY::LUTHER$ show status Status on 6-JUN-2010 21:00:31.93 Elapsed CPU : 0 00:00:07.70 Buff. I/O : 655 Cur. ws. : 512 Open files : 0 Dir. I/O : 41 Phys. Mem. : 240 Page Faults : 8643 Ctrl/T: ------- By the way: Ctrl/T displays a single line of statistical information about the current process. The statistical information includes node and user name, current time, current process, central processing unit (CPU) usage, number of page faults, level of I/O activity, and memory usage. SNORRY::LUTHER$ (press Ctrl/T) SNORRY::LUTHER 14:58:41 (DCL) CPU=00:00:02.63 PF=5391 IO=177 MEM=425 The command will not "disturb" your current session (like for example an editor session with EVE). 1.6 The "RECALL" command, and "Ctrl/B": ======================================= Especially, when you have entered a long command, and you need to execute it again, it would be nice if you could retrieve it from the buffer again. You can display your previously entered commands by using one of the following methods: - Pressing Ctrl/B (scrolls through your previous commands) - Using up arrow and down arrow keys - Using the RECALL command $ RECALL get's your previous command $ RECALL/ALL lists all your previous commands $ RECALL 4 get's the fourth command from the RECALL/ALL list Just try it! Now that we have explored the environment a bit, let's see how you use DCL to view or manipulate Directories and Files. ============================== 2. VMS Files and directories: ============================== 2.1 file specification: ======================= A VMS file specification consists of three parts: 1 physical or logical device name, like USER$DISK: 2 directory or sub-directory, like [USER], or [USER.ARTHUR] 3 the file name itself, which has the form: name.type;version where name is an alphanumeric string of up to 40 characters, type is the file type (up to 40 characters), and v is the version number between 1 and 32767, e.g. PROG.EXE;17, or TEST.TXT;1 So, a file completely qualified could be written like USER$DISK:[USER.ARTHUR]PROG.EXE;17 Note, in the example above, that the Directory "ARTHUR" lies within the directory "USER". Thus, complete file specification of a file stored on a disk has the following format: device:[directory.subdirectory]filename.type;version The device and directory part are known as the pathname, and may be prefixed by 'nodename::' if they are on a different computer. So, in general form, a file specification might even consist of 4 parts, like PARIS::WORK:[USER.ARTHUR]mytekst.txt;17 So, maybe you ar familiar with the unix style of denoting directories as in for example "/home/lisa/docs". But in VMS or OpenVMS, directories are denoted like for example: SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.SNMP] which means that the directory SNMP is located in directory TCPIP, which itself is located in EXAMPLES, which is located within SYSHLP. That is just the way directories are denoted in VMS/OpenVMS. 2.2 The SET DEFAULT (or SET DEF) COMMAND: ========================================= If you would like to go to the directory [SYSHLP.EXAMPLES.TCPIP.SNMP], use the "set def" command, which is the equivalent of the "cd" command in Unix. $ SET DEF SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.SNMP] That will make tjat directory, your default directory. To go back, for example, your home, use something similar to $ SET DEF SYS_USERS:[ALBERT] 2.3 SHOW DEFAULT: ================= Each user has defaults for the device name, and the "home" directory. You may find out your current defaults by typing $ SHOW DEFAULT This shows you the device and directory which VMS will assume "you are in", if you specify a file name only. SNORRY::LUTHER$ show default SYS_USERS:[LUTHER] You may change the default, separately for the device name and the directory, using $ SET DEF new_default If you enter a file name in any command using simply the filename alone, e.g. TEST.TXT , the system will precede the name by the default internally, and take the highest version number of the file. Some default file types: Type Default for Contents COM DCL DCL command file (like Unix script) EXE VMS Executable program image C C Compiler C source CXX CXX Compiler C++ source FOR Fortran Compiler FORTRAN source MAR Macro Assembler VAX Macro Assembler DAT Many things Data file, e.g. program input/output LIS Compilers etc. Informational listing (e.g. compiler output) LOG VMS batch jobs Batch job output log file MAP LINKer Map created by object linker OBJ LINKer Object file (= relocatable binary) OLB LIBRARY Librarian Binary object library PS TEX, DECwrite etc. PostScript laser printer commands TEX TEX Text to be processed by TeX DVI TEX Device-independent output from TeX If you conform to the standard extensions, compiling, linking and running could be as easy as: $ FORTRAN TUT $ LINK TUT $ RUN TUT $ cc myprg $ link myprg $ run myprg 2.4. MANIPULATING FILES: ======================== 2.4.1 Directories: ================== A directory is a special type of file that contains information about the other files contained within it. The directory part of a file specification is delimited by [] brackets. SET DEFAULT commands specify the "default directory", where files will be read from or written to, unless the filename explicitly specifies a different directory. Nomenclature [] The current directory. [-] One level up. [-.-] Two levels up. [--] Ditto. [...] Everything below the current level. [.*] All subdirectories one level down. SYS$LOGIN The user's login directory. SYS$SCRATCH The user's scratch directory (for large operations). Actions $ CREATE/DIR [.SUBDIR] Create a subdirectory. $ SET DEFAULT [.SUBDIR] Move to this new subdirectory. $ SET DEFAULT PRGDISK:[SHARED.PROGRAMS] Move to this location. $ SET DEFAULT [-] Move to one directory level up. $ SET DEFAULT SYS$LOGIN Move to the user's home directory. To delete a directory, first make all files in it deletable, then remove them: $ SET FILE/PROT=O:RWED [.SUBDIR...]*.*;* $ DELETE [.SUBDIR...]*.*;* Issue this command until no error messages appear. then do: $ SET FILE/PROT=O:RWED SUBDIR.DIR $ DELETE SUBDIR.DIR; DEL, DIR, PURGE, RENAME, SEARCH and file management: ---------------------------------------------------- 2.4.2 DIR command: ================== In general, it is useful to look at all your files now and then, using the command $ DIR List everything in the current directory. $ DIR DISK:[DIR1.SUBDIR1] List everything in the specified directory. $ DIR/SIZE/OWNER/PROT JOURNAL*.* List all files beginnig with "JOURNAL" and show their size, who owns them, and what their protections are. $ DIR/SIZ=ALL or DIR/SIZ=ALL filename $ DIRECTORY/SINCE=TODAY/SIZE=ALL $ HELP DIR More information on the DIRECTORY command. 2.4.3 DEL command: ================== You can delete a file by typing (after having run the above example) $ DEL TUTORIAL.EXE;1 (the ; is always necessary, but the version number may be omitted if you mean the highest version number) which will do it, and tell you so if your LOGIN.COM file defaults are set correctly. You can also use the confirm switch. $ DELETE/CONFIRM PROTO.*;* | USER$DISK:[ARTHUR]PROTO.DAT;2, DELETE? [N]: 2.4.4 PURGE command: ==================== A useful command is PURGE, e.g. $ PURGE TUTORIAL.OBJ (without version number or ; ) which will delete all files TUT.OBJ except the highest version number. A qualifier allows you to specify how many versions to keep, counting from the top, e.g. $ PURGE/KEEP=3 name.type will keep the three highest version numbers of the file specified. 2.4.5 RENAME command: ===================== Sometimes you want to RENAME a file, like in the following example: $ RENAME balancesheet.txt;2 balancesheet.bak As you may have guessed by now, no file is ever deleted or replaced by the system, but a higher version is created instead. This makes the PURGE command so necessary if you are to avoid using up all of your disk space allocation, or `disk quota'. 2.4.5 SEARCH command: ===================== Just like 'find' in DOS or 'grep' in UNIX, DCL allows to find stringvalues in files with the SEARCH command. Just a few examples will give you the general idea: $ SEARCH *.* Mary means find Mary, MARY, mary, etc... in the latest version of any file $ SEARCH/MATCH=EXACT *.*;* "Mary" means find only Mary in any version of any file $ SEARCH *.* search_string means search all files for search_string $ SEARCH *.FOR string which (in the above case) will show all lines containing "string" from all files of type .FOR onto the screen, or onto an output file if you specify the /OUTPUT=filename option after SEARCH. 2.4.6 USE OF WILDCARDS: ======================= Just like in DOS or UNIX, you can use wildcards in filemanagement or listings. Use asterisks "*" and percent signs "%" in connection with file names, where an asterisk stands for "any alphanumeric string" and a "%" for "any alphanumeric character". A command containing this type of name specification is called a WILD card. Examples: $ PURGE *.* or just $ PUR will delete all but the highest version number of all your files. The command $ DIR *.COM will list all your files of file type COM, $ DIR MY*.%%A will list all your files starting with `MY' and having a file type of three characters, the last one being `A'. ===================================================================== 3. ASSIGN command for substituting a logical name for physical name: ===================================================================== You can use a logical device name in a file specifications instead of a physical device, for example like $ ASSIGN/NOLOG DEV$DISK:[USER.ALBERT] ALBERT$DIR: Files in the DEV$DISK:[USER.ALBERT] directory could then be referred to as ALBERT$DIR:filename.type;v . This is shorter, and has the advantage that if you move your files for any reason, you need only change one logical name and everything will work in the new directory. Any logical names which you ASSIGN or DEFINE are placed in a separate name table for your process only. These will disappear once you log off, so frequently used logical names should be assigned in your LOGIN.COM command file. To see what logical names are defined for you enter $ SHOW LOGICAL or $ SHOW LOGICAL SY* to see only the logical names beginning with th letters "SY", for example. More examples: $ ASSIGN $DISK1:[DATA.MEMOS] MEMOSD The ASSIGN command in this example equates the partial file specification $DISK1:[DATA.MEMOS] to the logical name MEMOSD. $ ASSIGN/USER_MODE $DISK1:[DATA.MEMOS]WATER.TXT TM1 The ASSIGN command in this example equates the logical name TM1 to a file specification. After the next image runs, the logical name is deassigned automatically. ================================== 4. Copy command and filetransfer: ================================== When VAX and Alphas are clustered, transfer is trivial. Certain disks on the different machines are available to all members of the cluster, and they have names of the form "node_name$disk", eg. YR9$DKA300, YRL$DKA100, YRE$DKA400. You can see which disks are available using the SHOW DEVICE D command. Example of filetransfer: To copy a file from user ALBERT's directory on DEV$DISK to use FRED's directory on PDS$DISK without changing the filename you would enter $ COPY DEV$DISK:[ALBERT]TCM.TEX PDS$DISK:[FRED] There is usually no need for this sort of transfer, since you can access all the main disks from every cluster member anyway, though you might want your own copy of a file to modify. When VAX or Alphas are not clustered, but are linked by DECnet as is often the case, file transfer over DECnet is achieved by a simple copy command, which looks like this: $ COPY node_name1::from_file node_name2::to_file Note that the remote file specification must contain the DECnet node name in addition to the disk and directory name. The node name is followed by ::. Example: To copy a file called COMMAND.COM from directory DISK$USERS:[TEST] on a VAX or Alpha called VMS1, to your current default directory you would enter $ COPY VMS1::DISK$USERS:[TEST]COMMAND.COM [] Usually the system managers of the machines you use will have set up what is know as a DECnet proxy entry to allow you to copy easily, as in the above example. If this isn't the case, then you may have to specify your remote username and password when you do the copy. Imagine you were copying a local file called REPORT.TXT to a remote machine, STARBOSS, on which you had an account with username JOHN and password PASSWORD01. You place the username and password in quotes, between the username and the :: . $ COPY REPORT.TXT STARBOSS"JOHN PASSWORD01"::USER$DISK:[REPORTS] If you were to miss out the USER$DISK:[REPORTS] part of the destination specification, then the file would end up in STARBOSS's default login directory. It's quite easy to lose track of where files are going during a COPY, so it's a good idea to add the /LOG qualifier to the copy command so that you are told exactly where the file ended up ! =================================== 5. File protection or permissions: =================================== Four forms of access to your files may be allowed or denied to four classes of users. - The four access classes are: Read access, Write access, Delete access and Execute access. - The four classes of users are: System manager, Owner, Group members and World (everyone). You may show the current protection of a file by entering a command like the following: $ DIRECTORY/PROTECTION to see something like: Directory USER$DISK:[ALBERT] NOTE1.TXT;1 124 NOV-19-1989 (RE,RWED,RW,R) The notation in parentheses shows that the system manager is given read and execute access to the file NOTE1.TXT, while the owner retains all four forms of access, members of the same group have read and write access while "world" users (anyone else) has only read access. You may alter the access to the file with the command SET PROTECTION by specifying the access and the filename: $ SET PROTECTION=(S:RW,O:RWE,G:R,W:) NOTE1.TXT;1 ====================================== 6. VMS-UNIX command conversion chart: ====================================== Sometimes it is helpfull to compare some unix commands to VMS commands: UNIX VMS ---- ---- help HELP man command HELP COMMAND ls DIR{ECTORY} ls -ls DIR /OWNER /DATE /SIZE /PROT{ECTION} ls .. DIR [-] ls subdirectory DIR [.SUBDIRECTORY] ls subdir1/subdir2 DIR [.SUBDIR1.SUBDIR2] mkdir subdir CREATE/DIR [.SUBDIR] cd SET DEFAULT SYS$LOGIN cd subdir SET DEF [.SUBDIR] cd ../subdir SET DEF [-.SUBDIR] cp file1 file2 COPY FILE1 FILE2 cp file subdir COPY FILE [.SUBDIR] mv file1 file2 RENAME FILE1 FILE2 rm file DELETE FILE; rmdir subdir SET FILE/PROTECTION=(OWNER:RWED) DEL SUBDIR.DIR; chmod ... filenm SET FILE/PROT=(...) FILENM u O{WNER}: g G{ROUP}: o W{ORLD}: r R w W x E D (DELETE) chmod 755 filenm SET FILE/PROT=(O:RWED,G:RE,W:RE) FILENM command > file command/OUTPUT=FILE command < file command/INPUT=FILE rlogin machine SET HOST MACHINE script {scriptfile} SET HOST MACHINE /LOG{=SCRIPTFILE} (default typescript) (default SETHOST.LOG) vi/edit file ADAM FILE (EDT default editor) EDIT/TPU FILE (programmable editor w/windows) LS{EDIT} FILE (language sensitive editor) cat file TYPE FILE more file TYPE/PAGE FILE cat file1 ... filen > newfile COPY FILE1,...,FILEN NEWFILE cat file1 ... filen >> newfile APPEND FILE1,...,FILEN NEWFILE lno file SEARCH/NUMBER FILE "" lpr file HOTPRINT FILE -or- PRINT FILE lpq SHOW QUEUE grep string file SEARCH FILE STRING sort file > outfile SORT FILE OUTFILE sort file SORT FILE SYS$OUPTUT write user PHONE USER mail user MAIL SEND ps SHOW SYSTEM date SHOW TIME -or- SHO DATE scriptfile @DCLSCRIPT.COM . scriptfile sh < scriptfile source scriptfile alias command 'string' (csh) COMMAND :== STRING (see consultant) alias SHOW SYMBOL/GLOBAL/ALL .login -or- .profile LOGIN.COM stdin SYS$INPUT (VMS logicals) stdout SYS$OUTPUT stderr SYS$ERROR whoami SHOW PROCESS dc -or- bc CALC ^D (logout) LO{GOUT} ^D (EOF) ^Z netcp (unix to unix) NETCOPY (vms to vms) transfer TRANSFER nroff RUNOFF passwd SET PASSWORD ==================================================== 7. DCL Commands, common ones in alphabetical order: ==================================================== Common commands: ---------------- On VMS or OpenVMS you can enter the "help" command, or "help ", to get information on a certain DCL command. $ help This will show you that you can retrieve help on the following commands: := = @ ACCOUNTING ALLOCATE ANALYZE APPEND ASSIGN ATTACH AUTHORIZE AUTOGEN BACKUP BASIC CALL CANCEL CC CLOSE COBOL CONFIGURE CONNECT CONTINUE CONVERT COPY CREATE CXXDEMANGLE DCL_Tips DEALLOCATE DEASSIGN DEBUG DECK DECthreads DEFINE DELETE DEPOSIT DIFFERENCES DIRECTORY DISABLE DISCONNECT DISMOUNT DSR DUMP EDIT ENABLE ENDSUBROUTINE EOD EOJ Errors EXAMINE EXCHANGE EXIT EXTRACT Ext_File_Specs FDL FINGER FONT FORTRAN FTP FTSV GENCAT GOSUB GOTO HELP Hints ICONV IF INITIALIZE INQUIRE INSTALL Instructions JAVA JOB LANCP LATCP Lexicals LIBRARY LICENSE Line_editing LINK LMCP LOCALE LOGIN LOGOUT LPQ LPRM MACRO MAIL MERGE MESSAGE MIBCOMP MONITOR MOUNT NCP NCS ON OPEN PASCAL PASSWORD PATCH PHONE PIPE POLYCENTER PRINT PRODUCT PSWRAP PURGE Queues RCP READ RECALL RECOVER RENAME REPLY REQUEST RETURN REXEC RLOGIN RMS RPC RPCGEN RSH RTL_Routines RUN RUNOFF SEARCH SET SHOW SORT SPAWN SPOOL START STOP SUBMIT SUBROUTINE Symbol_Assign SYNCHRONIZE SYSGEN SYSMAN System_Services Sys_Files Sys_Parameters TCPIP_Services TCPTRACE TELNET TFF TN3270 TYPE UNLOCK UNZIP UNZIPSFX V72_Features VIEW WAIT WRITE ZIP Overview This is a list of the commands most likely to be used by nonprivileged users. Actions $ _numeric == 20 Define a symbol that contains a numeric value. $ _symbol :== a string Define a symbol that contains a string. $ append Append one or more files to one file. $ assign Define a logical name. $ attach Transfer control of terminal to a different process. $ backup Make copies of files, directories, disks. $ continue After a {ctrl Y}, let program continue. $ convert Change the format or contents of a file. $ copy Copy a file or files. $ create Create a file. $ create/dir Create a directory. $ deassign Cancel a logical name assignment. $ define Define a logical name. $ delete Delete a file, queue entry, or symbol. $ differences Compare two files, show the differences. $ directory List a directory's contents. $ edit Edit a file. Many editors available. $ ftp Transfer files to/from another computer. $ help Get help on a topic. $ mail Start the MAIL utility, send/read/print/delete mail. $ merge Merge up to 10 presorted files into one. $ monitor Check on disk, processor, etc. usage. $ multinet ping Check the route to another computer. $ phone Interactive conversation with another user. $ posix Enter the POSIX shell (like Unix). $ print Print a file. $ purge Delete lower numbered versions of a file. $ rcp Copy files to/from another computer. $ read Read information from the screen or a file. $ recall Recall previous commands. $ rename Change the name of a file or files. $ rshell Execute commands on another computer. $ run Run a program. $ search Search file(s) for one or more strings. $ set Set many things: terminal, queue entry, priority,etc. $ show Show whatever SET can set. $ sort Sort the contents of a file. $ spawn Create a subprocess. $ stop Stop a process or queue. $ submit Start a batch job. $ talk Interactive conversation with user on another computer. $ telnet Interactive session on another computer. $ type Type a file to the terminal. $ write Send information to the screen or a file. Commands related to devices: ---------------------------- Devices Overview There are many types of devices available on OpenVMS systems, such as disks, tapes, terminals, printers, and so forth. The operating system will assign each of them a name like "DKA100:" (note the trailing colon). One special device is NLA0:, which is the null device. Output directed there disappears - convenient for disposing of status messages and such. Actions $ SHOW DEVICE [/FULL] [device_name] Display information on one or more devices. Disk and tape commands, usually issued by privileged users. $ INIT device_name volume_label Initialize the device. $ MOUNT device_name volume_label Mount the volume in the device on the system. $ DISMOUNT device_name Dismount the volume in the device. Terminal commands, typically anybody can use these. $ SHOW TERM Show terminal characteristics. $ SET TERM [/WIDTH=132] [/PAGE=50] [/SPEED=9600] Change terminal characteristics. 8. COMMAND FILES: ================= Just as in UNIX or DOS, you can create scripts, or batchfiles that run a series of statements. Command files are files containing a series of DCL commands, just as you would enter them from a terminal. They can either be executed interactively, or submitted for batch execution - see the later section on batch jobs. A command file which you have executed already, perhaps without realising it, is your LOGIN.COM . This is executed automatically every time you log in, although you can stop it from being executed (if you have made some sort of mistake in it that causes a loop, say) by adding /NOCOM after your user name when you log in. The default file type for command files is .COM , so if you just type @MYCOMMANDS then VMS will assume that you mean MYCOMMANDS.COM. Each command must be preceeded by a $ sign; lines without this are interpreted as input to procedures called from the command file, and are otherwise skipped, with an error message. Continuation lines are indicated by a "-" (hyphen = minus sign) at the end of the line, and simple continuation in the next line, e.g. $ SHOW - SYSTEM ! This would be a silly place to split a line, but you get the idea Example: Try this ! Create the file TESTCOM.COM and try to predict its action. The exclamation mark is a comment character in DCL, like * in FORTRAN, // in C++. $ CREATE TESTCOM.COM ! Whatever you type now goes into the file TESTCOM.COM $ WRITE SYS$OUTPUT "Hello World !" $ EXIT 'Ctrl-Z' The 'Ctrl-Z' terminates the input to the CREATE command. If you $ TYPE TESTCOM.COM It should look like this: $ WRITE SYS$OUTPUT "Hello World !" $ EXIT To execute the file, you have to enter $ @TESTCOM 9. DCL SYMBOLS OR VARIABLES: ============================ Symbols are useful for defining shorthand for frequently used commands, and for use as "variables" in DCL command procedures. Using the single "=" sign you can define symbols which are local to a command file, ie. they disappear at exit from it, or you can define global symbols which remain valid until you logoff, using "==". Examples: three = 3 file := SYS$EXAMPLES:TUT.FOR can be used inside the command file, e.g. setting up the files for a batch job. Please note that "=" assigns a value, ":=" assigns a string to a symbol. Placing the string in double quotes " is also acceptable. three == 3 file :== SYS$EXAMPLES:TUT.FOR string1 :==The whole of this line will end up in STRING1 string2 == "This is a string too" All these symbols will however remain valid even after the execution of the command file, because the "==" was used DCL is case-insensitive for the most part, so it doesn't matter whether your symbols are uppercase or lowercase. Having said that I tend to use lowercase for my own symbols, and uppercase for built in DCL commands, just to make it easier to read and tell them apart. To invoke a symbol, put it between quotes, e.g. 'file', as in $ file := MYDATA.DAT ! Local symbol $ COPY 'file' FARVAX::SCRATCH$DEVICE: Note that it is the right-hand single quote ' both before and after the symbol. If you use the symbol within a quoted string, you need two quotes before it and one after, like this: $ file :== TESTCOM.COM ! Global symbol $ WRITE SYS$OUTPUT "Copying ''file' to the remote system." ! Two ' $ COPY 'file' FARVAX::SCRATCH$DEVICE: ! One ' Since symbols can be defined directly, without command files, try the above definition of file followed by the command $ TYPE 'file' and you will understand. Symbols are often used to provide a shorthand way of specifying a frequently used command with several qualifiers. For example, instead of having to type $ DIRECTORY/SINCE=TODAY/SIZE=ALL ! Get all files created today, show their size you could define a symbol in your LOGIN.COM like this: $! Get all files created today, show their size $ SDIR:==DIRECTORY/SINCE=TODAY/SIZE=ALL then you need only type $ SDIR to get the same information. It is considered bad practise to define symbols that clash with built-in DCL commands, because it can lead to all sorts of confusion regarding the expected behaviour of commands. To see what symbols you already have defined you can type $ SHOW SYMBOL * This assumes that someone hasn't defined a symbol called SHOW to do something else ! If you suspect that they have, you can get rid of symbols by typing $ DELETE/SYMBOL symbol_name You could guarantee that DELETE would give you the DCL DELETE functionality by doing $ DELETE:=DELETE and indeed you will occasionally see this done in command files, to insulate them from the effects of any users who have been foolish enough to define symbols that clash with DCL commands. =============== 10. QUEUE's: =============== 10.1 The PRINT command: ======================= In order to print a file, it could be as easy as $ PRINT filename This command will queue the file for printing to your standard output queue. SYS$PRINT is the name of the default print queue. if I had wanted to print on a different printer, I would have added the /QUEUE=queuename qualifier to the end of his print command. The PRINT command has a large number of "/qualifiers": Parameter Qualifiers /AFTER /BACKUP /BEFORE /BURST /BY_OWNER /CHARACTERISTICS /CONFIRM /COPIES /CREATED /DELETE /DEVICE /EXCLUDE /EXPIRED /FEED /FLAG /FORM /HEADER /HOLD /IDENTIFY /JOB_COUNT /LOWERCASE /MODIFIED /NAME /NOTE /NOTIFY /OPERATOR /PAGES /PARAMETERS /PASSALL /PRIORITY /QUEUE /REMOTE /RESTART /RETAIN /SETUP /SINCE /SPACE /STYLE /TRAILER /USER As an example of using qualifiers, take a look at the following command: $ PRINT/FORM=1/QUEUE=SYS$LASER mytext.txt 10.2 Queue's: ============= To use a printer or batch processing on your system, you must use queues. The queue manager controls queue activity. The queue database consists of a master file as well as queue and journal files, which store information about queues and jobs. Before you can perform any queue operation, you must start the queue manager and create the queue database. Your System Adminstrator will already have implemented that. Queues are used for print and batch jobs: ----------------------------------------- Queues are used on OpenVMS to organize noninteractive tasks so that they may be processed sequentially. Files on their way to the printer, E-mail, and batch jobs (program runs which are noninteractive and run from command files) all go through queues. The commands listed here are used to check on or modify the status of jobs in queues. $ SET ENTRY/AFTER=TOMORROW entry_number Delay processing of entry until tomorrow(s) $ SHOW QUEUE [queue_name] Show jobs in the queue(s) $ SHOW ENTRY Show any jobs this user has running $ DELETE/ENTRY=entry_number [queue_name] Stop a job $ SUBMIT [/NOPRINT] [/QUEUE=queue_name] [/AFTER=time] [/LOG] procedure Start a batch job in a queue Examples: Once a job has been entered in a batch job queue, you can monitor its status with the SHOW ENTRY command or the SHOW QUEUE command. If you have no jobs in the queue, the system displays the following message: $ SHOW QUEUE AMST_BATCH Batch queue AMST_BATCH, on AMST:: To see complete information on your jobs, use the /FULL qualifier with the SHOW ENTRY or SHOW QUEUE command. To see the status of other jobs in the queue, use the SHOW QUEUE/ALL command. In the following example, entry number 999 is displayed: $ SUBMIT EXCHAN.DAT Job EXCHAN (queue SYS$BATCH entry 999) started on SYS$BATCH $ SHOW ENTRY 999 Entry Jobname Username Blocks Status ----- ------- -------- ------ ------ 999 EXCHAN BLASS 3 Executing On batch queue SYS$BATCH =============== 11. Processes: =============== SHOW PROCESSES: --------------- $ SHOW SYSTEM $ SHOW PROCESS/ALL $ SHOW PROCESS /id=process_id $ SHOW PROCESS process_name which gives information about your process. Normal user priority is 4, but certain system tasks have higher priority, and user batch jobs always have lower priority (1, 2 or 3 for long, medium or normal batch jobs) so that they use up spare CPU time with very little inconvenience to interactive users. Normal users can only set their priority, or that of their batch jobs, up to the base limit of 4. VMS also manages the batch job queues, allows the different VAX and Alphas in the cluster to talk to each other, and many other tasks of this nature. You can tell which processes are hogging which resources using variants of the MONITOR command: $ MONITOR process/topcpu Who's using all the CPU? $ MONITOR process/topfault Who's page faulting so much? $ MONITOR disk What's going on on the disks? CREATE A SUBPROCESS: -------------------- Use the SPAWN command. Here is an example of interrupting a program, creating a subprocess, doing some stuff in it interactively, and then returning to the program running in the main process: $ run myprog ^Y $ spawn $ dir *.dat Do a couple of commands, this is just an example $ logout $ continue The program completes normally. Note that giving a command other than spawn or attach would have killed the halted program "myprog". As another example, take a look at the following: $ TYPE MICE.TXT Once the weather turns cold, mice may find a crack in the foundation and enter your house. They are looking for food and shelter from the harsh weather ahead. . . Ctrl/Y $ SPAWN %DCL-S-SPAWNED, process DOUGLASS_1 spawned %DCL-S-ATTACHED, terminal now attached to process DOUGLASS_1 $ MAIL MAIL> . . . MAIL> EXIT $ LOGOUT Process DOUGLASS_1 logged out at 31-DEC-1999 12:42:12.46 %DCL-S-RETURNED, control returned to process DOUGLASS $ CONTINUE Once inside, they may gnaw through electrical wires and raid your food. Because mice reproduce so quickly, what started as one or two mice can quickly become an invasion. If you seal You can also use Spawn to get a subprocess running at the same time as the main process. For instance, the following will start the program XV (an interactive graphics program for DECwindows) and then let you continue with the current session: $ spawn/nowait xv $ Note that a ^Y or ^C at the top session will kill the subprocess. STOP A PROCESS: --------------- If you know the name or process ID, and it belongs to you, or you have sufficient privileges: $ stop process_name or $ stop/id=process_number a typical number: 20200242 You can get the process_name or _number from: $ show system If the process you want to stop is your current session, or the program you are running, use: {^Y} Control key and Y, stop the current program. $ logout BATCHJOBS: ---------- How do I start a batch job? --------------------------- First you need to put a series of DCL commands into a file, because batch jobs require DCL procedure files to tell them what to do. (They aren't interactive, so you can't do so from your terminal.) Here is a simple procedure file that sorts a couple of files and then merges them. Generally, you would use an editor to create this file. -- just an example 'test.com' file: $! first line of "TEST.COM", note no error checking!!! $ sort file1.txt file1.txt_sorted $ sort file2.txt file2.txt_sorted $ sort file3.txt file3.txt_sorted $ merge file1.txt_sorted,file2,file3 file4.txt $ delete file%.txt. $ write sys$Output "All done" $!last line of file This is one command you might use to start it on a batch queue: $ SUBMIT/NOTIFY/NOPRINT/LOG=SYS$LOGIN: [QUEUE=queue_name] test.com This says: Put it on the batch queue named "queue_name" Notify my terminal when it finishes (only works if you are still logged in!) Keep a log file, it will be SYS$LOGIN:TEST.LOG Don't print the log file It will tell you the entry number when it is placed on the queue. How do I stop a batch job? -------------------------- First, figure out the entry number, if you didn't write it down when you issued the SUBMIT command to place it on the QUEUE. $ SHOW ENTRY Show all entries that you own in any queue. Figure out which one is yours. Then do: $ DELETE/ENTRY=entry_number =========================== 12. BOOTPROCEDURE OpenVMS: =========================== Generic description of the bootprocedure: ----------------------------------------- Together, the booting and startup processes comprise the following steps: BOOT command | loads primary bootstrap On VAX, this is VMB.EXE On Alpha this is APB.EXE | loads secondary bootstrap: SYS$SYSTEM:SYSBOOT.EXE | SYSBOOT.EXE loads parameters from default parameter file | loads Executive | loads SWAPPER | loads SYSINIT | starts STARTUP process and executes STARTUP.COM | This will also execute SYSTARTUP_VMS.COM You enter the BOOT command. The boot block, a fixed location on disk, points to the primary bootstrap image, which is loaded from disk into main memory. - On VAX systems, the primary bootstrap image is VMB.EXE. - On Alpha systems, the primary bootstrap image is APB.EXE. The primary bootstrap image allows access to the system disk by finding the secondary bootstrap image, SYS$SYSTEM:SYSBOOT.EXE, and loading it into memory. SYSBOOT.EXE loads the system parameters stored in the default parameter file into memory. If you are performing a conversational boot, the procedure stops and displays the SYSBOOT> prompt. Otherwise, SYSBOOT.EXE loads the operating system executive into memory and transfers control to the executive. When the executive finishes, it executes the SWAPPER process. The SWAPPER creates the SYSINIT process. Among other actions it performs, SYSINIT creates the STARTUP process. STARTUP executes SYS$SYSTEM:STARTUP.COM (unless you indicated another file using SYSMAN, SYSGEN, or conversational boot). STARTUP.COM executes a series of other startup command procedures, including SYSTARTUP_VMS.COM. The current values of system parameters are written back to the default parameter file. The boot process finishes, and you can log in to the operating system. To start an Oracle database automatically when the VMS system is rebooted, place the following commands in a command procedure, e.g. DUA0:[ORACLE7]START_SALES.COM. $ @ORA_ROOT:[DB_SALES]ORAUSER_SALES $ INSORACLE $ @ORA_ROOT:[DB_SALES]STARTUP_EXCLUSIVE_SALES Then edit the system startup file SYS$MANAGER:SYSTARTUP_VMS.COM and add the following command at the end of the file: $ SUBMIT/USER=ORACLE7 DUA0:[ORACLE7]START_SALES ================================================ 13. Some basics of the OpenVMS EVE Text Editor: ================================================ VMS offers several built-in text editors. Two famous ones are "EDT" and "EVE". On VMS EDT was default, on OpenVMS EVE is default/ EDT: ==== Enter EDIT at the VAX DCL prompt, with no qualifiers, like $ edit test.txt This invokes the EDT line editor. This was the most popular VMS text editor, for a long time. EVE: ==== A more recent VMS editor is called "EVE", short for the "Extensible VMS Editor" or "Extensible Versatile Editor". If you start "edit" on OpenVMS, you will invoke "EVE". EVE is a general-purpose text editor based on the DEC Text Processing Utility (DECTPU). If you do not get EVE, try "edit/tpu" from the DCL prompt, like in: $ edit/tpu test.txt EVE is the default editor on the OpenVMS operating system. Unless you define a different default editor, EVE is invoked when you enter the EDIT command. So, on OpenVMS you can just start "edit" to get EVE. You will enter EVE, and you will see a screen similar to: ---------------------------------------------------------------------- [End of file] Buffer: TEST.TXT | Write | Insert | Forward EVE VT100 keypad defined. (For keypad diagram, press PF2.) ---------------------------------------------------------------------- You will start in the "write" mode. So you can start typing your text right away. You can go to the "command mode" with the "Do" key (PF4). Then the ":" will appear at the bottom of the screen, where you can enter commands, like "write", to save your file. Some very basic navigation tips: -------------------------------- - use the cursor "arrows" to move around the text - just use the "Return" key to enter a new line - use the "backspace" key to delete letters "to the left" - Using Ctrl/A, as a toggling key", moves you to "insert mode" (insert text into existing text), or "overstrike" mode (type over existing text) - Press the Do key (PF4) to enter the "command mode". Searching for text: ------------------- Pressing the Find key (on a PC, the F1 key) displays this prompt just below the EVE status line: Forward Find: - To change the direction of searches, the Change Direction key is F11 on a VT terminal and F3 on a PC. - To repeat a search, press F1 twice. Replacing text: --------------- You could first use Find (F1 on a PC) to find the text, and then replace it. If you want to distinguish between lower and upper case letters, use the SET FIND CASE EXACT command. Command: SET FIND CASE EXACT Command: FIND John The REPLACE command is case sensitive. If the old string has any uppercase letters, EVE searches for exact case matches. Just use the REPLACE command like this: REPLACE {"old-string" ["new-string"] old-string[new-string]} old-string This is the text you want to replace. If the string is more than one word, put it in quotation marks or let EVE prompt you for the string. Use all lowercase to search for any occurrence; use mixed case or all uppercase to search for an exact match. If you do not specify an old string, EVE prompts for one. Pressing the Return key or the Do key at the prompt without typing anything cancels the operation. new-string This is the text you want to replace the old string. If the string is more than one word, put it in quotation marks or let EVE prompt you for the string. If you do not specify a new string---if you press Return at the prompt---REPLACE deletes the old string without substituting any text. Saving your file: ----------------- To save your file, press the Do key "PF4" (or F4 on a PC) to display the Command: prompt, and enter the WRITE command. EVE saves your file and returns your cursor to its former position so that you can continue to edit the file. In general, you can use one of the following methods to save your edits: - WRITE FILE command Saves a file without terminating your editing session - EXIT command Terminates your editing session and saves the changes to your file - QUIT command Terminates your editing session without saving changes to your file Stopping the EVE session: ------------------------- Enter QUIT at the Do key's (or F4 on a PC) Command: prompt to quit EVE and return to the DCL prompt. The above constitutes ofcourse just about enough information to survive an EVE session. But anyway, it's a start. ========================================================= 14. Just a few notes on OpenVMS System Management Tools: ========================================================= 14.1 The OpenVMS Management Station (manageWorks): -------------------------------------------------- The "OpenVMS Management Station" is a powerful, Windows based management tool, for system managers and others who perform account management tasks on OpenVMS systems. OpenVMS Management Station software provides a comprehensive user interface to OpenVMS account management across multiple systems. It's Windows based software that you install on a PC and use to perform OpenVMS management operations. It has more or less the "look and feel" of the NT "User manager for Domains" interface (or Active Directory Users and Computers), which is well known from Windows NT networks (NT, Win2K, Win2K3, Win2K8). Note: those Windows management tools, are not exactly the same across the different Windows Server Systems, like NT 4 compared to Win2Kx, but essentially, the GUI of OpenVMS Management Station resembles "the look and feel" so much. For example, it's very easy to add, delete, or modify an OpenVMS account, using the Management Station. Creating an account usually involves the following steps: - Add a UAF entry - Grant rights identifiers - Create a directory - Create disk quotas - Grant network proxies These steps require that you use DCL, the Authorize utility, and the DISKQUOTA component of the SYSMAN utility. OpenVMS Management Station provides an easy-to-use interface to this process. This tool can add a user authorization file (UAF) entry, grant rights identifiers, create an OpenVMS directory, set a disk quota, set up OpenVMS Mail characteristics etc.. for an account. 14.2 DCL: --------- We already have seen some DCL commands. Some commands are for real users too, but some commands are reserved for the system manager, like for example the "analyze" command, the "backup" command, or the "mount" command. In section 15, we will explore some of those types of commands. 14.3 SYSMAN: ------------