Entering Commands

In command procedures, each new command must begin with a dollar sign ($). [1] The only lines that should not begin with a dollar sign are the continuations of long commands and input data lines. Many users include a space between the dollar sign and the command. This practice is optional, but is shown in this book.

After the dollar sign, enter the DCL command as if you were typing it at the DCL command prompt. It is recommended that you type out each command verb, parameter, keyword, and qualifier in its entirety. Command procedures often remain in use for years. During that time, additional commands may be added to OpenVMS, some of which may cause earlier acceptable abbreviations to become ambiguous. Using complete commands also aids in the readability of your procedures. For these reasons, it is considered good form to avoid abbreviations in command procedures.

To split a command line onto multiple lines, follow the normal rule of ending the incomplete line with a hyphen. Do not precede continuation lines by a dollar sign.

As with interactive DCL commands, anything after an exclamation mark is a comment and will be ignored by DCL.

The following example shows commands (1), comments (2), and a command split across multiple lines (3):

     $ directory /date=(created,modified) data.lst                     (1)     $ !                                                               (2)     $ ! Sort the file                                                 (2)     $ !                                                               (2)     $ sort data.lst * - ! A comment may be placed here too            (3)       /key=(position:1,size:10)/key=(position:12,size:3,descending) - (3)       /key=(position:28,size:2)/key=(position:16,size:10)             (3)     $ exit                                                            (1) 

[1]It is technically possible to omit the dollar sign, but only under a strict set of circumstances. It is not good practice and should be avoided.



Getting Started with OpenVMS(c) A Guide for New Users
Getting Started with OpenVMS: A Guide for New Users (HP Technologies)
ISBN: 1555582796
EAN: 2147483647
Year: 2005
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net