OpenVMS Command Definition, Librarian, and Message Utilities ManualOrder Number: AA--QSBDB--TE
November 1996
This manual describes how to use the Command Definition Utility to modify the DIGITAL Command Language (DCL), how to use the Librarian utility to create and maintain OpenVMS libraries, and how to use the Message utility to supplement OpenVMS system messages with messages of your own. Revision/Update Information: This manual supersedes the OpenVMS Command Definition, Librarian, and Message Utilities Manual, Version 7.0. Software Version: OpenVMS Alpha Version 7.1 OpenVMS VAX Version 7.1
November 1996 Digital Equipment Corporation makes no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description. Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Digital or an authorized sublicensor. Digital conducts its business in a manner that conserves the environment and protects the safety and health of its employees, customers, and the community. © Digital Equipment Corporation 1996. All rights reserved. The following are trademarks of Digital Equipment Corporation: Bookreader, DECdirect, DECwindows, Digital, OpenVMS, OpenVMS Cluster, VAX, VAX DOCUMENT, VAXcluster, VMS, and the DIGITAL logo. All other trademarks and registered trademarks are the property of their respective holders.
ZK6100 The OpenVMS documentation set is available on CD-ROM.
PrefaceIntended AudienceThis manual is intended for programmers and general users of the OpenVMS operating system. Document StructureThis manual is divided into three parts. Chapter 1 describes the Command Definition Utility (CDU) and consists of the following sections:
Chapter 2 describes the Librarian utility (LIBRARIAN) and consists of the following sections:
Chapter 3 describes the Message utility (MESSAGE) and consists of the following sections:
Related DocumentsFor related information about these utilities, see the following documents:
For additional information on the Open Systems Software Group (OSSG) products and services, access the Digital OpenVMS World Wide Web site. Use the following URL:
Reader's CommentsDigital welcomes your comments on this manual. Print or edit the online form SYS$HELP:OPENVMSDOC_COMMENTS.TXT and send us your comments by:
How To Order Additional DocumentationUse the following table to order additional documentation or information. If you need help deciding which documentation best meets your needs, call 800-DIGITAL (800-344-4825).
ConventionsThe name of the OpenVMS AXP operating system has been changed to the OpenVMS Alpha operating system. Any references to OpenVMS AXP or AXP are synonymous with OpenVMS Alpha or Alpha. In this manual, every use of DECwindows and DECwindows Motif refers to DECwindows Motif for OpenVMS software. The following conventions are also used in this manual:
Chapter 1
|
$ DIFFERENCES/MODE=ASCII MYFILE.DAT YOURFILE.DAT |
DIFFERENCES is the verb and /MODE is a qualifier that has as its value the keyword ASCII. MYFILE.DAT and YOURFILE.DAT are file specifications that function as the command parameters.
The next example shows a command that uses a keyword as a parameter value:
$ SHOW DEFAULT |
Here, SHOW is the verb and DEFAULT is a keyword used as a parameter.
1.1.2 System and Process Command Tables
When you log in, the system command table in SYS$LIBRARY:DCLTABLES.EXE is copied to your process and DCL uses this process command table to parse command strings. Changing your process command table does not affect SYS$LIBRARY:DCLTABLES.EXE. To change the DCL tables, you need the CMKRNL privilege.
The system command table is created from source files called command
definition files. A command definition file contains statements that
name and describe verbs. Digital maintains the command definition files
for DCL; they are not shipped with your system.
1.2 Using CDU
To use CDU:
Note that the foreign command facility is an alternate way to define
command verbs. The foreign command allows you to pass information about
a command string to an image. However, if you use the foreign command
facility, your program must parse the command string; DCL does not
parse the command string for you. For information about how to define a
foreign command, see the OpenVMS User's Manual.
1.3 Choosing a Table
The type of table you are modifying or creating affects the way that you write a command definition, process this definition, and write the code that executes your command.
The most common tables that you modify or create include your process
command table, the DCL table in SYS$LIBRARY, and new tables that allow
your programs to process commands.
1.3.1 Modifying Your Process Command Table
To add a command to your process command table, define the new command in a command definition file, specifying the name of an image for the command to invoke. Then use SET COMMAND to add the new command to your process command table and to copy the new table back to your process. For example, the following command adds a command in NEWCOMMAND.CLD to your process command table:
$ SET COMMAND NEWCOMMAND |
Now you can enter the new command after the DCL prompt. DCL will parse the command and then invoke the image that executes the command. Note that, when you write the source code for the new command, you must use the command language routines CLI$PRESENT and CLI$GET_VALUE to obtain information about the command string.
The first example in the CDU Examples section shows how to add a new command to your process command table and how to write the program that executes the new command.
To make the command in NEWCOMMAND.CLD available to you each time you
log in, include the SET COMMAND command in your LOGIN.COM file.
1.3.2 Adding a System Command
To add a command to the DCL command table in SYS$LIBRARY, define the command in a command definition file, specifying the name of an image for the command to invoke. Then use SET COMMAND to add the new definition to the DCL command table and copy the new table back to SYS$LIBRARY. (You must have the CMKRNL privilege to change the DCL command table.) For example:
$ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES - _$ /OUTPUT=SYS$LIBRARY:DCLTABLES NEWCOMMAND |
To make the new command available to other users, use the Install
utility.
1.3.3 Creating an Object Module
To create an object module for a new command table, define the commands in a command definition file, specifying the name of a routine in a program that executes the command. Then use SET COMMAND with the /OBJECT qualifier to create an object module from the command definition file. For example:
$ SET COMMAND/OBJECT NEWCOMMAND |
Now link this object module with the program that uses the table. Note that, when you link a command table with your program, the program must perform the functions of a command interpreter. That is, the program must obtain the command string and call the parsing routine CLI$DCL_PARSE to verify and create an internal representation of it. The program must also call CLI$DISPATCH to invoke the appropriate routine. Each command routine must use the DCL interface routines CLI$PRESENT and CLI$GET_VALUE to get information about the command string that invoked the routine.
The second example in the CDU Examples section shows how to write and
process command definitions for an object module and how to write a
program that parses commands and invokes routines.
1.4 Writing a Command Definition File
A command definition file contains information that defines a command and its parameters, qualifiers, and keywords. In addition, the command definition file provides information about the image or routine that is invoked after the command string is successfully parsed.
Use a text editor to create a command definition file that contains the statements you need to describe your new command; you can use clauses to specify additional information for statements. The default file type for a command definition file is .CLD.
Use exclamation points to delimit comments. An exclamation point causes all characters that follow it on a line to be treated as comments.
Any statement and its clauses can be coded using several lines. No continuation character is necessary. (However, you cannot split names across two lines.) If you place a statement on one line, you can separate clauses in the statement with either commas or spaces.
You cannot abbreviate statement or clause names in the command definition language. All names (for example, DEFINE SYNTAX, PARAMETER, and so forth) must be spelled out completely.
Most statements and clauses accept user-supplied information such as verb names, qualifier names, image names, and so on. You can specify this information as a symbol or as a string.
If the statement requires that a term be specified as a string, enclose the term in quotation marks. A string can contain any alphanumeric or special characters. To include quotation marks within a string, use two quotation marks (""). For example, PARAMETER P1, LABEL=PORT, PROMPT="Enter ""one"" value" produces the following:
Enter "one" value |
To maintain compatibility with earlier releases, CDU accepts character strings that are not enclosed in quotation marks. However, Digital recommends that you surround character strings in quotation marks. If you do not enclose a string in quotation marks, all alphabetic characters are converted to uppercase characters (capital letters). |
If a statement requires that a term be specified as a symbol, do not enclose the term in quotation marks. A symbol name must start with a letter or a dollar sign. It can contain from 1 to 31 letters, numbers, dollar signs, and underscore characters.
The Command Definition Language includes the following statements:
The following sections provide an overview of each CDU statement. See
the CDU File Statements section for more detailed descriptions of each type of
statement.
1.4.1 Defining Syntax
The DEFINE SYNTAX statement allows a command verb to use alternative syntax depending on the parameters, qualifiers, and keywords that are present in the command string. It redefines the syntax for a command verb previously defined by a DEFINE VERB or DEFINE TYPE statement, or it can be used to redefine the syntax for a command verb redefined by a previous DEFINE SYNTAX statement.
To define a syntax change, you must provide two DEFINE statements: a primary DEFINE statement and a secondary DEFINE statement. The primary DEFINE statement defines the affected command verb and it must include a SYNTAX=syntax-name verb clause to point to the secondary DEFINE statement. The secondary DEFINE statement defines the alternate syntax.
For example, you can write a command definition that uses a different syntax for a command verb when a particular qualifier is explicitly present, that is, not by default. When you include the specified qualifier in the command string, the syntax defined in the secondary DEFINE statement applies to the command verb described by the primary DEFINE statement.
This is the format for the DEFINE SYNTAX statement:
DEFINE SYNTAX syntax-name [verb-clause,[,...]] |
The syntax-name verb clause is the name of the alternate syntax definition. The verb clause specifies additional information about the syntax. You can use the same verb clauses in a DEFINE SYNTAX statement as are allowed in a DEFINE VERB statement, with one exception: you cannot use the SYNONYM verb clause with DEFINE SYNTAX.
The following example shows how a syntax change is used to specify an alternate command syntax when the /LINE qualifier is specified:
DEFINE VERB ERASE
IMAGE "DISK1:[MYDIR]ERASE"
QUALIFIER SCREEN
QUALIFIER LINE, SYNTAX=LINE (1)
DEFINE SYNTAX LINE (2)
IMAGE "DISK1:[MYDIR]LINE"
QUALIFIER NUMBER, VALUE(REQUIRED)
|
| Next | Contents | Index |
|
|
|
|
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
6100PRO.HTML
|
|