VSI OpenVMS User's Manual

Operating System and Version:
VSI OpenVMS x86-64 Version 9.2-1 or higher
VSI OpenVMS IA-64 Version 8.4-1H1 or higher
VSI OpenVMS Alpha Version 8.4-2L1 or higher

Preface

1. About VSI

VMS Software, Inc. (VSI) is an independent software company licensed by Hewlett Packard Enterprise to develop and support the OpenVMS operating system.

2. Intended Audience

This manual is intended for all users of the VSI OpenVMS operating system.

A system manager performs the administrative tasks that create and maintain an efficient computing environment. If you are a system manager or want to understand system management concepts and procedures, refer to the VSI OpenVMS System Manager's Manual.

3. Document Structure

Each chapter describes concepts and procedures for performing computing tasks. Basic information is presented first within each chapter; more complex concepts and procedures are presented last.

3.1. Getting Started

Refer to the following chapters to help you get started using the OpenVMS operating system:

3.2. Manipulating Text and Records

Refer to the following chapters to learn about editing text files and sorting records:
  • Chapter 8, Editing Text Files with EVE describes EVE, an interactive text editor that is included with the OpenVMS operating system. The chapter describes how to use EVE to create and edit new files or to edit existing files. It includes summaries of EVE commands.

  • Chapter 9, Sorting and Merging Files describes how to use the Sort/Merge utility (SORT/MERGE) to sort records from one or more input files or to merge files that have been sorted. The chapter includes a summary of Sort/Merge command qualifiers.

3.3. Ensuring Security

Refer to the following chapter to learn about security:

3.4. Logical Names and Symbols

Refer to the following chapters to learn about logical names and symbols:

3.5. Programming

Refer to the following chapters to learn about writing programs and using programming functions:

3.6. Managing Processes

Refer to the following chapter to learn about managing processes:
  • Chapter 16, Understanding Processes and Batch Jobs describes processes, which are environments created by the OpenVMS operating system that let you interact with the system. The chapter describes how and when to use subprocesses, programs, and batch jobs.

3.7. Reference Sections

The following information is provided for reference:

4. VSI Encourages Your Comments

You may send comments or suggestions regarding this manual or any VSI document by sending electronic mail to the following Internet address: . Users who have VSI OpenVMS support contracts through VSI can contact for help with this product.

5. OpenVMS Documentation

The full VSI OpenVMS documentation set can be found on the VMS Software Documentation webpage at https://docs.vmssoftware.com.

6. Conventions

The following conventions are used in this manual:

ConventionMeaning
Ctrl/XA sequence such as Ctrl/x indicates that you must hold down the key labeled Ctrl while you press another key (x) or a pointing device button.
PF1 XA sequence such as PF1 X indicates that you must first press and release the key labeled PF1 and then press and release another key (x) or a pointing device button.
EnterIn examples, a key name in bold indicates that you press that key.
A horizontal ellipsis in examples indicates one of the following possibilities:
  • Additional optional arguments in a statement have been omitted.

  • The preceding item or items can be repeated one or more times.

  • Additional parameters, values, or other information can be entered.

.
.
.
A vertical ellipsis indicates the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed.
( )

In command format descriptions, parentheses indicate that you must enclose choices in parentheses if you specify more than one. In installation or upgrade examples, parentheses indicate the possible answers to a prompt, such as:

Is this correct? (Y/N) [Y]

[ ]

In command format descriptions, brackets indicate optional choices. You can choose one or more items or no items. Do not type the brackets on the command line. However, you must include the brackets in the syntax for directory specifications and for a substring specification in an assignment statement. In installation or upgrade examples, brackets indicate the default answer to a prompt if you press Enter without entering a value, as in:

Is this correct? (Y/N) [Y]

|In command format descriptions, vertical bars separate choices within brackets or braces. Within brackets, the choices are optional; within braces, at least one choice is required. Do not type the vertical bars on the command line.
{ }In command format descriptions, braces indicate required choices; you must choose at least one of the items listed. Do not type the braces on the command line.
bold typeBold type represents the name of an argument, an attribute, or a reason. In command and script examples, bold indicates user input. Bold type also represents the introduction of a new term.
italic typeItalic type indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER=name), and in command parameters in text (where dd represents the predefined code for the device type).
UPPERCASE TYPEUppercase type indicates a command, the name of a routine, the name of a file, or the abbreviation for a system privilege.
Example

This typeface indicates code examples, command examples, and interactive screen displays. In text, this type also identifies website addresses, UNIX command and pathnames, PC-based commands and folders, and certain elements of the C programming language.

-A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line.
numbersAll numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixes-binary, octal, or hexadecimal-are explicitly indicated.

Chapter 1. Getting Started with the OpenVMS Operating System

OpenVMS is an interactive virtual memory operating system. While you are logged in to the computer, you and the system conduct a dialogue using the DIGITAL Command Language (DCL). You use DCL by entering commands from your keyboard, which the system reads and translates. The system responds by executing the command or by displaying an error message on the screen, if it cannot interpret what you entered. This chapter describes the following basic information that you need to know to interact with the OpenVMS operating system:
  • Logging in

  • Logging in from a PC

  • Choosing passwords for your account

  • Reading informational messages

  • Types of logins and login classes

  • Login failures

  • Changing passwords

  • Password and account expiration times

  • Guidelines for protecting your password

  • Recognizing system responses

  • Getting help about the system

  • Logging out of the system

  • Logging out without compromising system security

  • Networks

For complete descriptions of all commands referenced in this chapter, refer to the VSI OpenVMS DCL Dictionary and online help.

1.1. Logging In

Logging in consists of gaining access to the system and identifying yourself as an authorized user. When you log in, the system creates an environment from which you can enter commands. This environment is called your process.

The way you log in and out of the OpenVMS operating system depends on how the system is set up at your site. This section provides a general description of logging in to and out of the operating system. Check with your system manager for the procedures specific to your site.

To interact with the operating system, you must log in to a user account. An account is a name or number that identifies you to the system when you log in. That name or number tells the system where your files are stored and the type of access you have to other files.

Your system manager (or whoever authorizes system use at your installation) usually sets up accounts and grants privileges according to your needs. The type of access rights and privileges enabled for your account determine whether you have access to files, images, or utilities that might affect system performance or other users.

To access your account, you need to enter your user name and password. Your system manager usually provides you with your user name and initial password. Your user name identifies you to the system and distinguishes you from other users. Your password is for your protection. If you maintain its secrecy, other users cannot use system resources under your user name.

To log in to the system, use the following procedure:

Step

Task

1

The system displays a prompt for your user name:
Username:

Type your user name and press Enter. You have approximately 30 seconds to do this; otherwise, the system times out. If a timeout occurs, you must start the login procedure again.

The system displays your user name on the screen as you type it. For example:

Username: CASEY 

       The system prompts you for your password:

Password:
)

2

Type your password and press Enter.

The system does not display your password, which is sometimes referred to as no echo.

3

Depending on how your system manager has set up your account, you might be required to enter a second password or use an automatically generated password (see Section 1.3.4, “Types of Passwords”).

1.1.1. Successful Logins

If your login is successful, the system displays a dollar sign ($) in the left margin of your screen. The dollar sign is the default DCL prompt; it indicates that the system is ready to use.

The following example shows a successful login:
Username:  CASEY   
Password:                  
        Welcome to OpenVMS on node MARS
    Last interactive login on Friday, 11-DEC-2002 08:41
    Last non-interactive login on Thursday, 10-DEC-2002 11:05
$

1.1.2. Login Errors

If you make a mistake entering your user name or password or if your password has expired, the system displays the message
User authorization failure
and you are not logged in. If you make a mistake, press Enter and try again. If your password has expired, you need to change your password; the system will automatically display the Set Password: prompt. See Section 1.7, “Changing Passwords” for information on changing your password in this instance. If you have any other problems logging in, get help from the person who set up your account.

1.2. Logging In From a PC

In previous times, you would connect to a host computer with a video terminal that consisted of a monitor and a keyboard. All computing power resided on the host computer running the OpenVMS operating system, often located in a central computing room. Today it is more common to work from a personal computer (PC) or workstation that has its own set of independent computing capabilities. In this situation you connect to a host computer running OpenVMS via a terminal emulation program.

A terminal emulation program lets you connect to an OpenVMS system over a TCP/IP network, the Internet, or an intranet. Your interactions with the operating system display on the PC monitor using the interface provided by the terminal emulation program. To connect to OpenVMS in this way, start the terminal emulation program, select the system you want to connect to, and then log in to the OpenVMS operating system as described in this chapter.

1.3. Choosing Passwords for Your Account

To choose a secure password, use the following guidelines:
  • Include both numbers and letters in the password. Although a 6-character password that contains only letters is fairly secure, a 6-character password with both letters and numbers is much more secure.

  • Choose passwords that contain 6 to 10 characters. Adequate length makes passwords more secure. You can choose a password as long as 32 characters.

  • Do not select passwords from a dictionary or from your native language.

  • Avoid choosing words readily associated with your computer site or yourself, such as the name of a product or the model of your car.

  • Choose new passwords each time. Do not reuse old ones.

Your system manager or security administrator may set up additional restrictions, for example, not allowing passwords with fewer than 10 characters or not allowing repeats of passwords.

The following table provides examples of secure passwords and high-risk passwords (words that others might easily guess):

Secure Passwords

High-Risk Passwords

Nonsense syllables:

aladaskgam

eojfuvcue

joxtyois

Words with a strong personal association: your name, the name of a loved one, the name of your pet, the name of your town, the name of your automobile, etc.

A mixed string:

492_weid

$924spa

zu_$rags

A work-related term:

your company name a special project your work group name

1.3.1. Obtaining Your Initial Password

Typically, when you learn that an account has been created for you on the system, you are told whether a user password is required. If user passwords are in effect, your system manager will usually assign a specific password for your first login. This password has been placed in the system user authorization file (UAF) with other information about how your account can be used.

It is inadvisable to have passwords that others could easily guess. Ask the person creating the account for you to specify a password that is difficult to guess. If you have no control over the password you are given, you might be given a password that is the same as your first name. If so, change it immediately after you log in. The use of first or last names as passwords is a practice so well known that it is undesirable from a security standpoint.

At the time your account is created, you should also be told a minimum length for your password and whether you can choose your new password or whether the system generates the password for you.

1.3.2. Changing Your Initial Password

Log in to your account soon after it is created to change your password. If there is a time lapse from the moment your account is created until your first login, other users might log in to your account successfully, gaining a chance to damage the system. Similarly, if you neglect to change the password or are unable to do so, the system remains vulnerable. Possible damage depends largely on what other security measures are in effect. See Section 1.7, “Changing Passwords” for more information on changing passwords.

1.3.3. Restrictions on Passwords

The system screens passwords for acceptability, as follows:
  • It automatically compares new passwords to a system dictionary. This helps to ensure that a password is not a native language word.

  • It maintains a history list of your old passwords and compares each new password to this list to be sure that you do not reuse a password.

  • It enforces a minimum password length, which the system manager specifies in your UAF record.

The system rejects any passwords that it finds in a system dictionary, that you have used before, and that are shorter than the minimum password length specified in your UAF.

1.3.4. Types of Passwords

There are several types of passwords recognized by the OpenVMS operating system:
  • User password

    Required for most accounts. After entering your user name, you are prompted for a password. If the account requires both primary and secondary passwords, two passwords must be entered.

  • System password

    Controls access to particular terminals and is required at the discretion of the security administrator. System passwords are usually necessary to control access to terminals that might be targets for unauthorized use, such as dialup and public terminal lines.

  • Primary password

    The first of two passwords to be entered for an account requiring both primary and secondary passwords.

  • Secondary password

    The second of two passwords to be entered for an account requiring both primary and secondary passwords. The secondary password provides an additional level of security on user accounts. Typically, the primary user does not know the secondary password; a supervisor or other key person must be present to supply it. For certain applications, the supervisor may also decide to remain present while the account is in use. Thus, secondary passwords facilitate controlled logins and the actions taken after a login.

    Secondary passwords can be time-consuming and inconvenient. They are justified only at sites with maximum security requirements. An example of an account that justifies dual passwords would be one that bypasses normal access controls to permit emergency repair to a database.

1.3.5. Entering a System Password

Your security administrator will tell you if you must specify a system password to log in to one or more of the terminals designated for your use. Ask your security administrator for the current system password, how often it changes, and how to obtain the new system password when it does change.

To specify a system password, do the following:
Step

Task

1

Press the Enter key until the terminal responds with the recognition character, which is commonly a bell.

2

Type the system password and press Enter. There is no prompt and the system does not display the characters you type. If you fail to specify the correct system password, the system does not notify you. Initially, you might think the system is malfunctioning unless you know that a system password is required at that terminal. If you do not receive a response from the system, assume that you have entered the wrong password and try again.

3
When you enter the correct system password, you receive the system announcement message, if there is one, followed by the Username: prompt. For example:
MAPLE - A member of the Forest Cluster
     Unauthorized Access is Prohibited     
 
Username:

1.3.6. Entering a Secondary Password

Your security administrator decides whether to require the use of secondary passwords for your account at the time your account is created. When your account requires primary and secondary passwords, you need two passwords to log in. Minimum password length, which the security administrator specifies in your UAF, applies to both passwords.

As with a single password login, the system allots a limited amount of time for the entire login. If you do not enter a secondary password in time, the login period expires.

The following example shows a login that requires primary and secondary passwords:
     WILLOW - A member of the Forest Cluster
         Welcome to OpenVMS on node WILLOW
 
Username: RWOODS
Password:           Enter
Password:           Enter

    Last interactive login on Friday, 11-DEC-2002 10:22
$

1.3.7. Password Requirements for Different Types of Accounts

Four types of user accounts are available on OpenVMS systems:
  • Accounts secured with passwords that you or the security administrator change periodically. This account type is the most common.

  • Accounts that always require passwords but prohibit you from changing the password. By locking the password (setting the LOCKPWD flag in the UAF), the security administrator controls all changes made to the password.

  • Restricted accounts limit your use of the system and sometimes require a password.

  • Open accounts require no password. When you log in to an open account, the system does not prompt you for a password and you do not need to enter one. You can begin entering commands immediately. Because open accounts allow anyone to gain access to the system, they are used only at sites with minimal security requirements.

1.4. Reading Informational Messages

When you log in from a terminal that is directly connected to a computer, the OpenVMS system displays informational system messages, as shown in the following example.

WILLOW - A member of the Forest Cluster                        1

        Unlawful Access is Prohibited        
 
Username:  RWOODS
Password:
    You have the following disconnected process:               2
Terminal   Process name    Image name                              
VT320:     RWOODS          (none)
Connect to above listed process [YES]: NO
         Welcome to OpenVMS on node WILLOW                     3
    Last interactive login on Wednesday,  11-DEC-2002 10:20    4
    Last non-interactive login on Monday, 30-NOV-2002 17:39    5
        2 failures since last successful login                 6
 
          You have 1 new mail message.                         7

  $
Note the following about the example:

1

The announcement message identifies the node (and, if relevant, the OpenVMS Cluster name). It may also warn unauthorized users that unlawful access is prohibited. The system manager or security administrator can control both the appearance and the content of this message.

2

A disconnected process message informs you that your process was disconnected at some time after your last successful login but is still available. You have the option of reconnecting to the old process, in the state it was in before you were disconnected.

The system displays the disconnected message only when the following conditions exist:
  • The terminal where the interruption occurred is set up as a virtual terminal.

  • Your terminal is set up as one that can be disconnected.

  • During a recent session, your connection to the central processing unit (CPU) through that terminal was broken before you logged out.

In general, the security administrator should allow you to reconnect because this ability poses no special problems for system security. However, the security administrator can disable this function by changing the setup on terminals and by disabling virtual terminals on the system. For information on setting up and reconnecting to virtual terminals, refer to the VSI OpenVMS System Manager's Manual.

3

A welcome message indicates the version number of the OpenVMS operating system that is running and the name of the node on which you are logged in. The system manager can choose a different message or can suppress the message entirely.

4

The last successful interactive login message provides the time of the last completed login for a local, dialup, or remote login. The system does not count logins from a subprocess whose parent was one of these types.

5

The last successful noninteractive login message provides the time the last noninteractive (batch or network) login completed.

6

The number of login failure messages indicates the number of failed attempts at login. An incorrect password is the only source of login failure that is counted. To attract your attention, a bell rings after the message appears.

7

The new mail message indicates if you have any unread mail messages.

1.4.1. Suppressing Messages

A security administrator can suppress the announcement and welcome messages, which include node names and operating system identification. Because login procedures differ according to operating system, it is more difficult to log in without this information.

The last login success and failure messages are optional. Your security administrator can enable or disable them as a group. Sites with medium-level or high-level security needs display these messages because they can indicate break-in attempts. In addition, by showing that the system is monitoring logins, these messages can be a deterrent to potential illegal users.

1.4.2. Successful Login Messages

Each time you log in, the system resets the values for the last successful login and the number of login failures. If you access your account interactively and do not specify an incorrect password in your login attempts, you may not see the last successful noninteractive login and login failure messages.

1.5. Types of Logins and Login Classes

Logins can be either interactive or noninteractive. When you log in interactively, you enter a user name and a password. In noninteractive logins, the system performs the identification and authentication for you; you are not prompted for a user name and password.

In addition to interactive and noninteractive logins, the OpenVMS operating system recognizes different classes of logins. How you log in to the system determines the login class to which you belong. Based on your login class, as well as the time of day or day of the week, the system manager controls your access to the system.

1.5.1. Interactive Logins

Interactive logins include the following login classes:
  • Local

    You log in from a terminal connected directly to the central processor or from a terminal server that communicates directly with the central processor.

  • Dialup

    You log in to a terminal that uses a modem and a telephone line to make a connection to the computer system. Depending on the terminal that your system uses, you might need to execute a few additional steps initially. Your site security administrator can give you the necessary details.

  • Remote

    You log in to a node over the network by entering the DCL command SET HOST. For example, to access the remote node HUBBUB, you enter the following command:
    $ SET HOST HUBBUB

    If you have access to an account on node HUBBUB, you can log in to that account from your local node. You have access to the facilities on node HUBBUB, but you remain physically connected to your local node.

    For additional information on remote sessions, see Section 1.12.2, “Ending a Remote Session”.

1.5.2. Noninteractive Logins

Noninteractive logins include the following:
  • Network Logins

    The system performs a network login when you initiate a network task on a remote node, such as displaying the contents of a directory or copying files stored in a directory on another node. Both your current system and the remote system must be nodes in the same network. In the file specification, you identify the target node and provide an access control string, which includes your user name and password for the remote node.

    For example, a network login occurs when user GREG, who has an account on remote node PARIS, enters the following command:
    $ DIRECTORY PARIS"GREG 8G4FR93A"::WORK2:[PUBLIC]*.*;*

    This command displays a listing of all the files in the public directory on disk WORK2. It also reveals the password 8G4FR93A. A more secure way to perform the same task would be to use a proxy account on node PARIS. For an example of a proxy login, see Section 10.5.3, “Using Proxy Login Accounts to Protect Passwords”.

  • Batch Logins

    The system performs a batch login when a batch job that you submitted runs. Authorization to build the job is determined at the time the job is submitted. When the system prepares to execute the job, the job controller creates a noninteractive process that logs in to your account. No password is required when the job logs in.

1.6. Login Failures

Logins can fail for any number of reasons. One of your passwords might have changed or your account might have expired. You might be attempting to log in over the network or from a modem but be unauthorized to do so. The following table summarizes common reasons for login failure:

Failure Indicator

Reason

No response from the terminal

A defective terminal, a terminal that requires a system password, or a terminal that is not powered on.

No response from any terminal

The system is down.

No response from the terminal when you enter the system password

The system password changed.

System messages:

 

"User authorization failure"

A typing error in your user name or password.

The account or password expired.

"Not authorized to log in from this source"

Your particular class of login (local, dialup, remote, interactive, batch, or network) is prohibited.

"Not authorized to log in at this time"

You do not have access to log in during this hour or this day of the week.

"User authorization failure" (and no known user failure occurred)

An apparent break-in has been attempted at the terminal using your user name, and the system has temporarily disabled all logins at that terminal by your user name.

The following sections describe the reasons for login failure in more detail.

1.6.1. Terminals That Require System Passwords

You cannot log in if the terminal you attempt to use requires a system password and you are unaware of the requirement. All attempts at logging in fail until you enter the system password.

If you know the system password, perform the steps described in Section 1.3.5, “Entering a System Password”. If your attempts fail, it is possible that the system password has been changed. If you do not know the system password and you suspect that this is the problem, try to log in at another terminal or request the new system password.

1.6.2. Login Class Restrictions

If you attempt a class of login that is prohibited in your UAF record, your login will fail. For example, your security administrator can restrict you from logging in over the network. If you attempt a network login, you receive a message telling you that you are not authorized to log in from this source.

Your security administrator can restrict your logins to include or exclude any of the following classes: local, remote, dialup, batch, or network.

1.6.3. Shift Restrictions

Another cause of login difficulty is failure to observe your shift restrictions. A system manager or security administrator can control access to the system based on the time of day or the day of the week. These restrictions are imposed on classes of logins. The security administrator can apply the same work-time restrictions to all classes of logins or choose to place different restrictions on different login classes.

If you attempt a login during a time prohibited for that login class, your login fails. The system notifies you that you are not authorized to log in at this time.

1.6.4. Batch Jobs During Shift Restrictions

When shift restrictions apply to batch jobs, jobs you submit that are scheduled to run outside your permitted work times are not run. The system does not automatically resubmit such jobs during your next available permitted work time. Similarly, if you have initiated any kind of job and attempt to run it beyond your permitted time periods, the job controller aborts the uncompleted job when the end of your allocated work shift is reached. This job termination behavior applies to all jobs.

1.6.5. Failures During Dialup Logins

Your security administrator can control the number of opportunities you are given to enter a correct password during a dialup login before the connection is automatically broken.

If your login fails and you have attempts remaining, press the Enter key and try again. You can do this until you succeed or reach the limit. If the connection is lost, you can redial the access line and start again.

The typical reason for limiting the number of dialup login failures is to discourage unauthorized users attempting to learn passwords by trial and error. They already have the advantage of anonymity because of the dialup line. Of course, limiting the number of tries for each dialup does not necessarily stop this kind of break-in attempt. It only requires the perpetrator to redial and start another login.

1.6.6. Break-In Evasion Procedures

If anyone has made a number of failed attempts to log in at the same terminal with your user name, the system can respond as though a break-in attempt is in progress. That is, the system concludes that someone is attempting to gain illegal access to the system by using your user name.

At the discretion of your security administrator, break-in evasion measures can be in effect for all users of the system. The security administrator controls how many password attempts are allowed over what period of time. Once break-in evasion tactics are triggered, you cannot log in to the terminal—even with your correct password—during a defined interval. Your security administrator can tell you how long you must wait before reattempting the login, or you can move to another terminal to attempt a login.

If you suspect that break-in evasion is preventing your login and you have not personally experienced any login failures, contact your security administrator immediately. Together, you should attempt another login and check the message that reveals the number of login failures since the last login to confirm or deny your suspicion of break-in attempts. If your system does not normally display the login message, your security administrator can use the Authorize utility (AUTHORIZE) to examine the data in your UAF record. With prompt action, your security administrator can locate someone attempting logins at another terminal.

1.7. Changing Passwords

Changing passwords on a regular basis promotes system security. To change your password, enter the DCL command SET PASSWORD.

The system manager can allow you to select a password on your own or can require that you use the automatic password generator when you change your password. If you select your own password, note that the password must follow system restrictions on length and acceptability (see Section 1.3.3, “Restrictions on Passwords”).

There is no restriction on how many times you can change your password in a given period of time.

The following example shows a password choice that is too short:
$ SET PASSWORD
Old password:
New password:
%SET-F-INVPWDLEN, password length must be between 12 and 32 
characters; password not changed

1.7.1. Selecting Your Own Password

If your system manager does not require use of the automatic password generator, the SET PASSWORD command prompts you to enter the new password. It then prompts you to reenter the new password for verification, as follows:
$ SET PASSWORD
New password:       
Verification:       

If you fail to enter the same new password twice, the password is not changed. If you succeed in these two steps, there is no notification. The command changes your password and Enters you to the DCL prompt.

Even though your security administrator might not require the password generator, you are strongly encouraged to use it to promote the security of your system.

1.7.2. Using Generated Passwords

If your system security administrator decides that you must let the system generate the password for you automatically, the system provides you with a list of password choices when you enter the DCL command SET PASSWORD. If your system is not set up to use automatically generated passwords, you can use them by specifying the SET PASSWORD command with the /GENERATE qualifier. The character sequence resembles native language words to make it easy to remember, but it is unusual enough to be difficult for outsiders to guess. Because system-generated passwords vary in length, they become even more difficult to guess.

Note

The password generator uses basic syllabic rules to generate words but has no real knowledge of any language. As a result, it can unintentionally produce words that are offensive.

In the following example, the system automatically generates a list of passwords made up of random sequences of characters. The minimum password length for the user in the following example has been set to 8 characters in their UAF record.
$ SET PASSWORD
Old password:           1

reankuna      rean-ku-na    2
cigtawdpau    cig-tawd-pau
adehecun      a-de-he-cun
ceebatorai    cee-ba-to-rai
arhoajabad    ar-hoa-ja-bad

Choose a password from this list, or press Enter to get a new list 3
New password:           4
Verification:           5
$ 6
Note the following about the example:

1

The user correctly specifies the old password and presses the Enter key.

2

The system responds with a list of five password choices ranging in length from 8 to 10 characters. Usually, the password that is easiest to pronounce is easiest to remember; therefore, it is the best choice.

On OpenVMS VAX systems, representations of the same word divided into syllables are displayed to the right of each password choice (as shown here).

3

The system informs the user that it is possible to request a new list by pressing the Enter key in response to the prompt for a new password.

4

The user enters one of the first five possible passwords and presses the Enter key.

5

The system recognizes that this password is one provided by the automatic password generator and responds with the verification prompt. The user enters the new password again and presses Enter.

6

The system changes the password and responds with the DCL prompt.

1.7.3. Generated Passwords: Disadvantages

There are two disadvantages to using generated passwords:
  • There is a possibility that you might not remember your password choice. However, if you dislike all the password choices in your list or think none are easy to remember, you can always request another list.

  • There is a potential for disclosure of password choices from the display that the command produces. To protect your account, change your password in private. If you perform the change on a video terminal, clear the display of password choices from the screen after the command finishes. If you use a printing terminal, properly dispose of all hardcopy output.

    If you later realize that you failed to protect your password in these ways, change your password immediately. Depending on site policy or your own judgment concerning the length of time your account was exposed, you should notify your security administrator that a security breach could have occurred through your account.

1.7.4. Changing a Secondary Password

To change a secondary password, use the DCL command SET PASSWORD/SECONDARY. You are prompted to specify the old secondary password and the new secondary password, just as in the procedure for changing the primary password. To remove a secondary password, press the Enter key when you are prompted for a new password and verification.

You can change primary and secondary passwords independently, but both are subject to the same change frequency because they share the same password lifetime.

1.7.5. Changing Passwords at Login

Even if your current password has not yet expired, you can change your password when you log in to the system by including the /NEW_PASSWORD qualifier with your user name. When you enter the /NEW_PASSWORD qualifier after your user name, the system prompts you to set a new password immediately after login.

The following example shows how to change your password when you log in:
WILLOW - A member of the Forest Cluster
 
Username: RWOODS/NEW_PASSWORD
Password:
         Welcome to OpenVMS on node WILLOW
            Last interactive login on Tuesday, 7-NOV-2002 10:20
            Last non-interactive login on Monday, 6-NOV-2002 14:20
 
Your password has expired; you must set a new password to log in
New password:
Verification:

1.8. Password and Account Expiration Times

Your system manager can set up your account so that your password, or the account itself, expires automatically on a particular date and time. Password expiration times promote system security by forcing you to change your password on a regular basis. Account expiration times help to ensure that accounts are available only for as long as they are needed.

1.8.1. Expired Passwords

As you approach the expiration time of your password, you receive an advance warning message. The message first appears 5 days before the expiration date and at each subsequent login. The message appears immediately below the new mail message and sounds the bell character on your terminal to attract your attention. The message indicates that your password is expiring, as follows:
WARNING – Your password expires on Thursday 11-DEC-2002 15:00
If you fail to change your password before it expires, you receive the following message when you log in:
Your password has expired; you must set a new password to log in
New password:

The system prompts you for a new password or, if automatic password generation is enabled, asks you to select a new password from those listed. You can abort the login by pressing Ctrl/Y. At your next login attempt, the system again prompts you to change your password.

1.8.2. Using Secondary Passwords

If secondary passwords are in effect for your account (see Section 1.3.4, “Types of Passwords”), the secondary password expires at the same time as the primary one. You are prompted to change both passwords. If you change the primary password and press Ctrl/Y before changing the secondary password, the login fails. The system does not record a password change.

1.8.3. Failure to Change Passwords

If the system manager decides not to force you to change your expired password upon logging in, you receive one final warning when you log in after your password expires, as follows:
WARNING -- Your password has expired; update immediately with
SET PASSWORD!

At this point, if you do not change the password or if the system fails before you have the opportunity to do so, you will be unable to log in again. To regain access, see your system manager.

1.8.4. Expired Accounts

If you need your account for a specific purpose for a limited time only, the person who creates your account may specify a period of time after which the account lapses. For example, student accounts at universities are typically authorized for a single semester at a time.

Expired accounts deny logins automatically. You receive no advance warning message before the account expiration date, so it is important to know in advance your account duration. The account expiration resides in the UAF record, which can be accessed and displayed only through the use of the OpenVMS Authorize utility (AUTHORIZE) by users with the SYSPRV privilege or equivalent—normally, your system manager or security administrator.

When your account expires, you receive an authorization failure message at your next attempted login. If you need an extension, follow the procedures defined at your site.

1.9. Guidelines for Protecting Your Password

Illegal system accesses involving the use of a correct password are more often traced to disclosure of the password by its owner than to surreptitious discovery. It is vital that you do not reveal your password to anyone.

You can best protect your password by observing the following rules:
  • Select reasonably long passwords that cannot be guessed easily. Avoid using words in your native language that appear in a dictionary. Consider including digits in your password. Alternatively, let the system generate passwords for you automatically.

  • Never write down your password.

  • Never give your password to another user. If another user obtains your password, change it immediately.

  • Do not include your password in any file, including the body of an electronic mail message. If anyone else reveals a password to you, delete the information promptly.

    The character strings that appear in conjunction with your actual password can make it easy for someone to find your password in a file. For example, a quotation mark followed by two colons ("::) always comes after a user name and password in an access control string. Someone attempting to break into the system could obtain your password by searching inadequately protected files for this string. Another way in which you might reveal your password is by using the word password in a text file, for example:
    My password is GOBBLEDYGOOK.
  • Do not use the same password for accounts on different systems.

    An unauthorized user can try one password on every system where you have an account. The account that first reveals the password might hold little information of interest, but another account might yield more information or more privileges, ultimately leading to a far greater security breach.

  • Before you log in to a terminal that is already on, invoke the secure terminal server feature (if enabled) by pressing the Break key. This is particularly relevant when you are working in a public terminal room.

  • Change your password every 3 to 6 months. VSI warns against sharing passwords. If you do share your password, change it every month.

  • Change your password immediately if you have any reason to suspect it might have been discovered. Report such incidents to your security administrator.

  • Log off a terminal you expect to leave unattended.

    Unauthorized users could use the terminal for malicious purposes, such as loading a password-stealing program.

  • Check your last login messages routinely. Be alert for login failure counts seem unusual. If you observe any unusual failure during a login, change your password immediately and notify your security administrator.

1.10. Recognizing System Responses

The system responds to the commands you enter in one or more of the following ways:
  • By executing the command. Generally, you know your command has executed successfully when the system prompt Enters (by default, the dollar sign).

  • By executing the command and informing you in a message what it has done.

  • By informing you of errors, if execution of a command is unsuccessful.

  • By supplying values (defaults) you have not supplied.

1.10.1. Default Actions

A default is the value supplied by the operating system when you do not specify one yourself. For example, if you do not specify the number of copies as a qualifier for the PRINT command, the system uses the default value 1. The operating system supplies default values in several areas, including command qualifiers and parameters. The defaults that the operating system uses with specific commands are described in each command's entry in the VSI OpenVMS DCL Dictionary.

1.10.2. Informational System Messages

The system responds to some commands by displaying information in a system message about what it has done. For example, when you use the PRINT command, the system displays the job identification number it assigned to the print job and shows the name of the print queue the job has entered.
$ PRINT MYFILE.LIS 
     Job MYFILE (queue SCALE_PRINT, entry 210) started on SYS$PRINT

Not all commands display informational messages. Successful completion of a command is usually indicated when the DCL prompt Enters. Unsuccessful completion is always indicated by one or more error messages.

1.10.3. System Error Messages

If you enter a command incorrectly, the system displays a system message and prompts you for the correct command string, as the following example shows:
$ CAPY )
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
 \CAPY\
$
The format for the 3-part code is:
DCL-W-IVVERB
where:

DCL

The OpenVMS facility or component name that Entered the error. In this example, the message is from DCL, the default command interpreter.

W

A severity level that indicates a warning. Other severity levels include S (success), I (information), E (error), and F (fatal or severe error).

IVVERB

The type of message. The message can be identified by the mnemonic IVVERB in the OpenVMS system messages documentation or by using the Help Message utility (MSGHLP) described in Section 1.11.3, “Getting Help on System Messages”.

You can also receive system error messages during command execution if the system cannot perform the function you have requested. For example, if you type a PRINT command correctly but the file you specify does not exist, the PRINT command informs you of the error with a message like the following:
$ PRINT NOFILE.DAT 
%PRINT-E-OPENIN, error opening CLASS1:[MAYMON]NOFILE.DAT; as input
-RMS-E-FNF, file not found
$

The first message is from the PRINT command. It tells you it cannot open the specified file. The second message indicates the reason for the first; that is, the file cannot be found. RMS refers to the OpenVMS file-handling software, Record Management Services; error messages related to file handling are generally OpenVMS RMS messages.

1.10.4. Checking Your Current Process

If you suspect that your process is not doing what you think it should be doing, press Ctrl/T. 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, which is listed in number of CPU-specific pages.

When you press Ctrl/T during an interactive terminal session, it momentarily interrupts the current command, command procedure, or image to display statistics. Although Ctrl/T disrupts the characters on the screen, it does not affect any procedure or editing session. For example, if a user named MCCARTHY on node GREEN presses Ctrl/T while using the EVE editor, the following line is displayed in the EVE message window:
GREEN::MCCARTHY 13:45:02 EVE CPU=00:00:03.33 PF=778 IO=295 MEM=315

To refresh the screen, press Ctrl/W.

Ctrl/T is disabled by default. If you know your system is running and Ctrl/T does not display statistical information, you can enable Ctrl/T with the DCL command SET CONTROL=T. Enter the command at DCL level (at the dollar sign ($) prompt), then press Ctrl/T again. Ctrl/T will remain in effect for the duration of your process, unless it is disabled from a program or command such as SET NOCONTROL=T. Note that your terminal must be set to BROADCAST mode for Ctrl/T to display on your screen. BROADCAST mode controls whether reception of broadcast messages (such as those issued by MAIL and REPLY) is enabled. To set your terminal to BROADCAST mode, enter the DCL command SET TERMINAL/BROADCAST at the DCL prompt.

1.11. Getting Help About the System

When you are logged in to the operating system, you can obtain information about using the system and available commands by using the HELP command. You can also get help on system messages by entering the HELP/MESSAGE command as shown in Section 1.11.3, “Getting Help on System Messages”.

1.11.1. Using Online Help

Use the following procedure to get help on OpenVMS commands and utilities:
Step

Task

1

Enter HELP at the DCL prompt and press Enter.

HELP displays a list of topics and the Topic? prompt.

2

To see information about one of the topics, type the topic name after the prompt and press Enter.

3

If you want information on one of the subtopics, type the name after the prompt and press Enter.

HELP displays information about that subtopic.

4

To redisplay the SHOW USERS topic and the list of subtopics, enter a question mark (?) at the Subtopic? prompt. If you want to read all of the listed subtopics, enter an asterisk (*).

5

If you want information on another topic, press Enter. Help displays the Topic? prompt.

6

To exit Help, press Enter until you Enter to the DCL prompt.

The following example shows the commands that you would enter to look for help about the SHOW USERS command:
$ HELP

HELP
.
. (HELP message text and subtopics)
.

Topic? SHOW USERS 

SHOW

  USERS

     Displays the user name and node name (in a VAXcluster environment)
     of interactive, subprocess, and batch users on the system.

     Format

       SHOW USERS  [username]



    Additional information available:

    PARAMETER  QUALIFIER
    /BATCH     /CLUSTER   /FULL      /INTERACTIVE     /NETWORK   /NODE
    /OUTPUT    /SUBPROCESS
    Examples

SHOW USERS Subtopic? EXAMPLES

SHOW

  USERS

    Examples
.
. (SHOW USERS Examples message text and subtopics, if any)
.
SHOW USERS Subtopic? 
SHOW Subtopic? 
Topic? 
$

1.11.2. Getting Help on Specific Commands

If you know the command you need information about, enter HELP and the command name. For example, to get help about the SHOW USERS command enter the following command:
$ HELP SHOW USERS 

If you need help but do not know what command or system topic to specify, enter the command HELP with the word HINTS as a parameter. Each task name listed in the HINTS text is associated with a list of related command names and system information topics.

The VSI OpenVMS DCL Dictionary contains more information about the HELP command.

1.11.3. Getting Help on System Messages

Use the Help Message utility (MSGHLP) to get online help for system messages. To display information on how the last command completed, type:
$ HELP/MESSAGE
You can also display information about a specific message by including the message identifier or words from the message text. For example:
$ HELP/MESSAGE BADACP
A message and its description can also be accessed by entering the message status code. For example:
$ HELP/MESSAGE/STATUS=%X00038090
If you do not know the message status code, you can view it by entering the command SHOW SYMBOL followed by the $STATUS global symbol. For example:
$ SHOW SYMBOL $STATUS
  $STATUS == "%X00038090"

The Help Message utility allows you to update the messages database with your own messages or to add comments to existing message descriptions. You can also extract a subset of messages from the messages database to create and print your own customized messages documentation. For details on how to use the Help Message utility, see OpenVMS System Messages: Companion Guide for Help Message Users.

1.12. Logging Out of the System

When you finish using the system, always log out. This prevents unauthorized users from accessing your account and the system. It is also a wise use of system resources; the resources you no longer need are available for other users.

To log out, enter LOGOUT at the DCL prompt. For example:
$ LOGOUT
The system displays a message, similar to the following message, confirming that you are logged out of the system:
$ LOGOUT
HARRIS logged out at 11-DEC-2002  12:42:48.12

You can log out of the system only when you are at the DCL prompt ($). You cannot enter the LOGOUT command while you are compiling or executing a program, using a text editor (such as EDT or EVE), or running a utility (such as Mail). First you must exit the program, editor, or utility. When the system displays the DCL prompt, you can log out.

1.12.1. Obtaining Accounting Information

To find out how much time you spent at the terminal (elapsed time), how much computer time you used (charged CPU time), and other accounting information, enter LOGOUT/FULL at the DCL prompt. For example:
$ LOGOUT/FULL
The system displays information similar to the following:
SIMPSON logged out at 11-DEC-2002  12:42:48.12

Accounting information:
 Buffered I/O count:      8005   Peak working set size:    212
 Direct I/O count:         504   Peak virtual size:        770
 Page faults:             1476   Mounted volumes:            0
 Charged CPU time:0 00:00:50.01  Elapsed time:0 02:27:43.06

1.12.2. Ending a Remote Session

You can end a remote session in two ways:
  • Use the remote system's logout procedure (for example, on an OpenVMS system, use the LOGOUT command).

  • Press Ctrl/Y twice to obtain the host system's prompt, which asks whether you want to abort the remote session. Answer YES (Y) if you want to abort the remote session. This method works regardless of the type of system running on the remote node.

When you end a remote session, the system displays the message %REM-S-END, control Entered to node NODENAME:: and Enters you to the process on the system from which you made the remote node connection.

1.12.3. Lost Network Connections

If a TCP/IP network connection to a remote system is lost, TCP/IP uses the best-effort delivery protocol, which is a characteristic of network technologies that attempts to deliver data but does not try to recover if there is an error such as a line failure.

If a DECnet network connection to a remote system is lost, DECnet will retransmit your data in an attempt to reestablish communications. If DECnet is unable to reestablish communications within a predetermined timeout period, your connection to the remote system is terminated, and the system displays the message Path lost to partner.

1.13. Logging Out Without Compromising System Security

Logging out of a session conserves system resources and protects your files. Leaving a terminal on line represents one of the greatest sources of inside break-ins. When you leave your terminal on line and your office open, you have effectively given away your password and your privileges and have left your files and those of the other members of your group unprotected. Any user can easily and quickly transfer all files accessible through your account. A malicious insider could rename and delete your files and any other files to which you have write access. If you have special privileges, especially privileges in the Files or All category, a malicious user can do major damage.

If you are working on a system that does not automatically lock after a determined time of inactivity, you should log out when you leave your office even for a brief period of time. If you have performed remote logins, you must log out of each node.

Your security administrator might ask you to break the connection to a dialup line when you log out. Breaking the connection to a dialup line:
  • Prevents others from taking advantage of an open access line. To access the line, someone must know the access number and must personally redial.

  • Is especially important if the dialup line you use is in a public area or where someone might use the terminal after you.

  • Saves resources by reducing the required number of dialup lines.

1.14. Networks

When computer systems are linked together, they form a network. Operating systems in an OpenVMS network are able to communicate with each other and share information and resources. Each system in a network is called a network node or host and is identified by a unique name or address. Host and node are used interchangeably, and mean a system connected to a network.

With OpenVMS, you have a choice of networking protocols. You can use the VSI TCP/IP Services for OpenVMS product or VSI's DECnet products within a single network, or you can have an environment where both products exist. VSI's primary network strategy for OpenVMS is TCP/IP, the industry-standard network protocol suite.

1.14.1. Network Nodes

When you are logged in to a network node, you can communicate with other nodes in the network. The node at which you are logged in is called the local node; other nodes on the network are called remote nodes. If you have access to an account on a remote node, you can log in to that account from your local node and perform tasks on that node while remaining connected to your local node.

Section 1.5.2, “Noninteractive Logins” describes how to log in to a remote node. Additional tasks you can perform on remote nodes are described in the appropriate chapters of this manual.

1.14.2. Executing Programs over Networks

Because of support provided by TCP/IP and DECnet software, programs can execute across the network as if they were executing locally. Because the network software is integrated within the operating system, it is easy to write programs that access remote files. To access a remote file in an application program, you need only include the name of the remote node and any required access control information in the file specification.

Task-to-task communications, a feature common to all TCP/IP or DECnet implementations, allows two application programs running on the same or different operating systems to communicate with each other regardless of the programming languages used. Examples of network applications are distributed processing applications, transaction processing applications, and applications providing connection to servers.

Note

In the examples of remote operations in this manual, proxy accounts enable users to perform operations on remote systems. Proxy accounts are one way users can access remote systems. For additional ways to access remote systems, see the VSI OpenVMS System Manager's Manual.

Chapter 2. Using DCL to Interact with the System

The DIGITAL Command Language (DCL) is a set of English-like instructions that tell the operating system to perform specific operations. DCL provides you with over 200 commands and functions to use in communicating with the operating system to accomplish computing tasks. DCL commands let you do the following:
  • Get information about the system

  • Work with files

  • Work with disks, magnetic tapes, and other devices

  • Modify your work environment

  • Develop and execute programs

  • Provide security and ensure that resources are used efficiently

The following table lists the DCL commands you use to perform a few common computing tasks:

Command

Task

COPY

Makes a copy of a specified file

COPY/FTP

Transfers files between hosts over a TCP/IP network

CREATE

Creates files or directories

DELETE

Erases a specified file and removes it from a directory

DIRECTORY

Displays the contents of a directory (list of files)

EDIT

Invokes the EVE text editor, allowing for viewing or modifying the contents of a text file

LOGOUT

Ends your terminal session

PRINT

Sends a specified file to a printer for printing

RENAME

Changes the name or the location of a specified file

SET

Controls how you see the system on the screen

SHOW

Displays the status of the system

TYPE

Displays the contents of a specified file on the screen

In this chapter you will learn how to use the DIGITAL Command Language. This chapter includes information about:
  • Entering DCL commands

  • The DCL command line

  • Rules for entering DCL commands

  • Entering parameters

  • Entering qualifiers

  • Entering dates and times as values

  • Recalling commands

  • Editing the DCL command line

  • Defining terminal keys

  • Key sequences

Differences in Your Local Environment

Note that this manual covers standard DCL commands only. System managers at your site may customize your system to support the local environment. They might decide to:
  • Use a different command language interpreter

  • Change the default action of some standard DCL commands

  • Disable some DCL commands

  • Alter some system defaults, such as the DCL prompt

  • Configure an environment with extended file specifications

For additional information on the commands, qualifiers, and parameters discussed in this chapter, refer to the VSI OpenVMS DCL Dictionary and online help.

2.1. Entering Commands

To enter a DCL command, type the command at the DCL prompt ($) and press Enter. DCL is not usually case sensitive; you can enter commands in either uppercase or lowercase letters.?

In the following example, the DCL command SHOW TIME is entered as follows:
$ SHOW TIME
The system responds by displaying the current date and time and returns the DCL prompt to indicate it is ready to accept another command:
11-DEC-2002  15:41:43
$ 

2.1.1. Usage Modes

You can use DCL in the following two modes:
  • Interactive

    In interactive mode, you enter commands from your terminal. One command has to finish executing before you can enter another.

  • Batch

    In batch mode, the system creates another process to execute commands on your behalf. A batch job is a command procedure or program that is submitted to the operating system for execution as a separate user process. After you submit the command procedure for batch execution, you can continue to use your terminal interactively.

    Batch jobs and network processes use DCL in batch mode. See Chapter 16, Understanding Processes and Batch Jobs for more information about processes.

2.1.2. Types of DCL Commands

When you enter a DCL command, it is read and translated by the DCL interpreter. The way the command interpreter responds to a command is determined by the type of command entered. The three types of DCL commands are as follows:
  • Built-in commands

    These commands are built into the DCL interpreter and are executed internally.

  • Commands that invoke programs

    DCL calls another program to execute the command rather than executing it internally. The program invoked to execute a command is referred to as a command image. This command image can be either an interactive program, a utility (such as Mail), or a noninteractive program (such as COPY).

  • Foreign commands

    A symbol that executes an image is referred to as a foreign command. A foreign command executes an image whose name is not recognized by the command interpreter as a DCL command. Refer to Chapter 12, Defining Symbols, Commands, and Expressions for complete information on symbols.

2.2. The DCL Command Line

DCL, like any language, has its own vocabulary and usage rules. DCL is made up of words (vocabulary) and word order (syntax or format). The following sections describe these two elements and explain how to construct a valid DCL command.

The following example shows the general format and parts of a DCL command line:
$  PRINT/COPIES = 5  GROCERY.LIS  Enter
1  2     3        4  5            6
The following list describes each element of the DCL command line:

1

DCL prompt

The dollar sign ($) is the default DCL prompt. When you work interactively with DCL, DCL displays the prompt when it is ready to accept a command.

2

DCL command

A DCL command specifies the name of the command. The command can be a built-in command, a command that invokes a program, or a foreign command. In this example, the DCL command is PRINT.

3

Qualifier

A qualifier modifies the action taken by the command. Some qualifiers modify the entire command, while others can modify specific command parameters. Some qualifiers can accept values. Qualifiers are always preceded by a slash (/). In this example, the qualifier is /COPIES.

4

Value

A value modifies a qualifier and is often preceded by an equal sign (=). A value can be a file specification, a character string, a number, or a DCL keyword. A keyword is a word reserved for use in certain specified formats.

In this example, the value is 5 (for 5 copies).

5

Parameter

A parameter specifies what the command acts upon. You must position parameters in a specified order within the command. Examples of parameter values include file specifications, queue names, and logical names.

6

Enter key

The Enter key ends the DCL command line and signals to the system that the command is ready for processing.

The following items may also be used in a DCL command line:
  • Labels

    Labels identify lines in command procedures. Use labels only within command procedures, which are described in Chapter 13, Introduction to Command Procedures and Chapter 14, Advanced Programming with DCL.

  • Keywords

    Keywords are words that are defined for use in certain specified formats. You must use keywords exactly as listed in the description of the particular DCL command you want to specify. For example, system, owner, group, and world are DCL keywords for the /PROTECTION qualifier of the SET SECURITY command. A DCL keyword can also have a value assigned to, or associated with, it.

  • Wildcard characters

    Wildcard characters are the asterisk (*), percent sign (%), ellipsis (...), and hyphen (-).

    The asterisk (*) is a multi-character wildcard and the percent sign (%) is a single-character wildcard. These wildcard characters can be used within or in place of a file name, file type, or a directory name. The asterisk can also be used in place of the file version number. The ellipsis (...) can be used in the directory name to represent all subdirectories of the current or listed directory. The hyphen (-) can be used in the directory name to represent the level above the current directory.

    For information about using wildcard characters with files and directories, see Section 3.2, “Using Wildcards with File Names”, Section 4.5, “Using Wildcards to Search the Directory Structure”, and VSI OpenVMS Guide to Extended File Specifications.

2.2.1. Syntax

Just as a spoken language depends on the order of words to create meaning, DCL requires that you put the correct elements of the command line in a specific word order or format.

Following are two examples of the syntax, or format, used for typical DCL commands:
command/qualifier=value=keyword

command parameter/qualifier

When you enter a DCL command, some parameters are required; they must be entered on the command line. If you do not enter them, the system prompts you to supply the missing information. A line beginning with an underscore (_) means that the system is waiting for your response.

When you are prompted for an optional parameter, press Enter to omit it. At any prompt, after you enter the required parameter, you can enter one or more of the remaining parameters and any additional qualifiers.

Note that you must enclose in quotation marks ("") any parameter containing a slash (/) or at sign (@).

In the following example, the TYPE command requires a file specification. Because a file specification is a required parameter of the TYPE command, if you do not enter one, the system requests it.
$ TYPE
_File:   WATER.TXT

2.2.2. Canceling Commands

If you press Ctrl/Z after a command prompt, DCL ignores the command and redisplays the DCL prompt.

2.2.3. Using Defaults

Some items, called defaults, need not be specified on the command line. When DCL performs an operation by default, it assigns a command certain values or performs certain functions associated with that command even though you may not have explicitly specified those values or functions when you entered the command. In general, the values and functions are those considered typical or expected by users.

DCL supplies default values in several areas, including command parameters and qualifiers. For parameter defaults, see the sections in this manual that describe the specific DCL command. Qualifier defaults are described in Section 2.5, “Entering Qualifiers”.

If the number of copies is not specified as a qualifier for the PRINT command, DCL uses the default value 1. In the following example, the default is overridden and multiple copies of the file are printed by including the /COPIES qualifier on the PRINT command line:
$ PRINT/COPIES=4 MYFILE.TXT

2.2.4. Entering Multiple Line Commands

If you enter a command longer than one line, you can continue the command onto the next line by following this procedure:

Step

Task

1

End the command line with a hyphen (-) and press Enter.

The system displays an underscore (_) followed by the DCL prompt ($).

2

Enter the rest of the command line after this prompt.

A line beginning with an underscore means that the system is waiting for your response.

Note the following:
  • You must include the appropriate spaces between command names, parameters, and so on.

  • Pressing Enter after the hyphen does not add a space.

  • There is no restriction to the number of continued lines you can use to enter a command, as long as you do not exceed the 1024-character limit.

  • You can also enter a long command line without specifying a hyphen; the system automatically wraps text to the next line. However, separating portions of the command lines with hyphens makes the command line easier to read.

The following example shows how to enter a multiple line command:
$ COPY/LOG FORMAT.TXT,FIGURE.TXT,ARTWORK.TXT -
_$ SAVE.TXT
You can use the DCL command PIPE to create complex command processing statements from a single DCL command. For example, you can execute one or more of the following operations from the same DCL command line:
  • Pipelining (a sequence of commands)

  • Input/output redirection

  • Multiple and conditional command execution

  • Background processing

For more detailed information, see Section 14.20, “Using the PIPE Command” and the description of the PIPE command in the VSI OpenVMS DCL Dictionary: N–Z.

2.3. Rules for Entering DCL Commands

The following rules apply when entering DCL commands. Refer to Chapter 5, Extended File Specifications for information about using extended file names in DCL commands.
  • Use any combination of uppercase and lowercase letters. The DCL interpreter translates lowercase letters to uppercase. Uppercase and lowercase characters in parameter and qualifier values are equivalent unless enclosed in quotation marks ( ).

  • Separate the command name from the first parameter with at least one blank space or a tab.

  • Separate each additional parameter from the previous parameter or qualifier with at least one blank space or a tab.

  • Begin each qualifier with a slash (/). The slash serves as a separator and need not be preceded by blank spaces or tabs.

  • If a parameter or qualifier value includes a blank space or a tab, enclose the parameter or qualifier value in quotation marks.

  • You cannot specify null characters (<NUL>) on a DCL command line, even if you enclose the null character in quotation marks.

  • Include no more than 127 elements (parameters, qualifiers, and qualifier values) in each command line.

    Each element in a command must not exceed 255 characters. The entire command must not exceed 1024 characters after all symbols and lexical functions are converted to their values.

  • You can abbreviate a command as long as the abbreviated name remains unique among the defined commands on a system. DCL looks only at the first four characters for uniqueness.

    The following commands are equal:
    $ PRIN/COPI=2 FORMAL_ART.TXT
    
    $ PRINT/COPIES=2 FORMAL_ART.TXT

    For greater clarity and to ensure that your command procedures are upwardly compatible, do not abbreviate commands in command procedures. See Chapter 13, Introduction to Command Procedures and Chapter 14, Advanced Programming with DCL for more information about using commands in command procedures.

2.4. Entering Parameters

File specifications are the most common type of parameter. DCL commands can accept input file specifications (files that are acted upon by a command) and output file specifications (files that are created by a command).

The following rules apply when specifying parameters in a command line:
  • Square brackets ([]) in command descriptions indicate optional items. For example, you do not have to enter a file specification in the following command:
    DIRECTORY [file-spec]
  • In a command description, anything not enclosed in square brackets is required. For example, you must enter a device name in the following command:
    SHOW PRINTER device-name
  • In general, precede an output file parameter with an input file parameter.

  • A parameter can be one item or a series of items. If you enter a series of items, separate the items with commas (,) or plus signs (+). Any number of spaces or tab characters can precede or follow a comma or a plus sign. Note that some commands regard the plus sign as a concatenator, not as a separator.

Examples

The following example shows how to copy the input file LISTS.TXT to the output file FORMAT.TXT:
$ COPY LISTS.TXT FORMAT.TXT
The following example line shows how you can enter a list of file specifications as the parameter:
DELETE file-spec[,...]
The following example shows how to specify a list of parameters. Here, three files are copied to a fourth file. The three file specifications, PLUTO.TXT, SATURN.TXT, and EARTH.TXT, constitute the first parameter. PLANETS.TXT is the second parameter. Note that there are no spaces (although they could have been inserted) between the PLUTO.TXT, SATURN.TXT, and EARTH.TXT file specifications.
$ COPY PLUTO.TXT,SATURN.TXT,EARTH.TXT PLANETS.TXT

2.5. Entering Qualifiers

There are three types of qualifiers:
  • Command

  • Positional

  • Parameter

You can abbreviate any qualifier name as long as the abbreviated name remains unique among all qualifier names for the same command. However, to ensure that your command procedures are upwardly compatible, do not abbreviate commands and qualifiers in command procedures.

Commands have default qualifiers; you do not have to specify a qualifier unless it is different from the command default. The following sections describe types of qualifiers and qualifier defaults. The VSI OpenVMS DCL Dictionary contains default information for specific commands.

2.5.1. Command Qualifiers

A command qualifier modifies a command and can appear anywhere in the command line. However, it is a good practice to place the qualifier after the command name. If you are specifying multiple qualifiers, you should place a command qualifier with other command qualifiers that follow the command name.

In the following example, /QUEUE is a command qualifier. The files SATURN.TXT and EARTH.TXT are queued to the print queue LN03_PRINT:
$ PRINT/QUEUE=LN03_PRINT SATURN.TXT,EARTH.TXT

2.5.2. Positional Qualifiers

A positional qualifier can modify commands or parameters and has different meanings depending on where you place it in the command string. If you place a positional qualifier after the command but before the first parameter, it affects the entire command string. If you place a positional qualifier after a parameter, it affects only that parameter.

In the following example, the first PRINT command requests two copies of the files SPRING.SUM and FALL.SUM. The second PRINT command requests two copies of the file SPRING.SUM but only one copy of FALL.SUM.
$ PRINT/COPIES=2 SPRING.SUM,FALL.SUM
$ PRINT SPRING.SUM/COPIES=2,FALL.SUM

2.5.3. Parameter Qualifiers

A parameter qualifier can be used only with certain types of parameters, such as input files and output files. For example, the BACKUP command accepts several parameter qualifiers that apply only to input and output file specifications.

In the following example, the /CREATED and /BEFORE qualifiers, which can be specified only with input files, select specific input files for the backup operation. The asterisk (*) is a wildcard character that replaces the file name. BACKUP selects all files with the .TXT file type that were created before December 11, 2002.
$ BACKUP *.TXT/CREATED/BEFORE=11-DEC-2002 NEWFILE.TXT

2.5.4. Conflicting Qualifiers

If you use two or more contradictory qualifiers on a command line, the right-most qualifier overrides the others.

Some commands contain conflicting qualifiers that cannot be specified in the same command line. If you use incompatible qualifiers, the command interpreter displays an error message.

Following is an example of conflicting qualifiers. Note that the PRINT command accepts only the /COPIES=2 and the /NOBURST qualifiers because they are the right-most qualifiers in the command line:
$ PRINT MYFILE/COPIES=3/BURST/COPIES=2/NOBURST EARTH.TXT

2.5.5. Values Accepted by Qualifiers

Qualifiers can accept keywords, file specifications, character strings, and numeric values. When you enter a value for a qualifier, separate the qualifier and the value with either an equal sign (=) or a colon (:).

Some qualifier keywords require additional information. In these cases, separate the keyword from its value with a colon or an equal sign.

To specify multiple keywords that require values, enclose the list in parentheses and separate the keyword and value with either an equal sign (=) or a colon (:).

Examples

Either command in this example is valid:
$ PRINT/COPIES=3 MYFILE.DAT

$ PRINT/COPIES:3 MYFILE.DAT
This is an example of a qualifier that requires additional information; the keyword "PROTECTION" is separated from its value by a colon or an equal sign (=):
$ SET SECURITY/PROTECTION:GROUP:RW MYFILE.DAT

$ SET SECURITY/PROTECTION=GROUP=RW MYFILE.DAT
This is an example of a qualifier that requires multiple keywords, each of which require multiple values:
$ SET SECURITY/PROTECTION=(OWNER=RWD,GROUP=RW) myfile.dat

$ SET SECURITY/PROTECTION=(OWNER:RWD,GROUP:RW) myfile.dat

2.6. Entering Dates and Times as Values

Certain commands and qualifiers (such as the PRINT/AFTER command) accept date and time values. You can specify these values in one of the following formats:
  • Absolute time

  • Delta time

  • Combination time (combines absolute and delta time formats)

2.6.1. Absolute Time Format

Absolute time is a specific date or time of day. The format for absolute time is as follows:
[dd-mmm-yyyy][:hh:mm:ss.cc]
The fields are as follows:

dd

Day of the month: an integer in the range 1 to 31

mmm

Month: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, or DEC

yyyy

Year: an integer

hh

Hour: an integer in the range 0 to 23

mm

Minute: an integer in the range 0 to 59

ss

Second: an integer in the range 0 to 59

cc

Hundredths of a second: an integer in the range 0 to 99

The following rules apply when specifying absolute time:
  • You can truncate the date or the time on the right.

  • If you specify both a date and a time, include a colon between them.

  • The date must contain at least one hyphen.

  • You can omit any of the fields within the date and time as long as you include the punctuation marks that separate the fields.

  • A truncated or omitted date field defaults to the corresponding fields for the current date.

  • A truncated or omitted time field defaults to zero.

  • If you specify a past time in a command that expects the current or a future time, the current time is used.

You can also specify an absolute time as one of the following keywords:

TODAY

The current day, month, and year at 00:00:00.0 o'clock

TOMORROW

00:00:00.00 o'clock tomorrow

YESTERDAY

00:00:00.00 o'clock yesterday

The following table shows examples of absolute time specifications:

Time Specification

Result

11-DEC-2002:13

1 p.m. on December 11, 2002

11-DEC

Midnight at the beginning of December 11 this year

15:30

3:30 p.m. today

19–

Midnight on the 19th day of the current year and month

19–:30

12:30 a.m. on the 19th of this month

2.6.2. Delta Time Format

Delta time is an offset (a time interval) from the current date and time to a time in the future. The general format of a delta time is as follows:
"+[dddd-][hh:mm:ss.cc]"
The fields are as follows:

dddd

Number of days; an integer in the range 0 to 9999

hh

Number of hours; an integer in the range 0 to 23

mm

Number of minutes; an integer in the range 0 to 59

ss

Number of seconds; an integer in the range 0 to 59

cc

Number of hundredths of seconds; an integer in the range 0 to 99

If a qualifier is described as a value that can be expressed as an absolute time, a delta time, or a combination of the two, you must specify a delta time as if it were part of a combination time. For example, to specify a delta time value of five minutes from the current time, use +:5 (not 0-0:5).

The following rules apply when specifying delta time:
  • You can truncate a delta time on the right.

  • If you specify the number of days, include a hyphen.

  • You can omit fields within the time as long as you include the punctuation that separates the fields.

  • If you omit the time field, the default is zero.

The following table shows some examples of delta time specifications:

Time Specification

Result

+3-

3 days from now (72 hours)

+3

3 hours from now

+:30

30 minutes from now

+3-:30

3 days and 30 minutes from now

+15:30

15 hours and 30 minutes from now

2.6.3. Combination Time Format

To combine absolute and delta times, specify an absolute time plus or minus a delta time. Use one of the following formats:
    "[absolute time][+delta time]"

     [absolute time][-delta time]

The variable fields and default fields for absolute and delta time values are the same as those described in the preceding sections.

The following rules apply when specifying combination time:
  • Precede the delta time value by a plus or minus sign. Note that the minus sign is the same keyboard key as the hyphen.

  • Enclose the entire time specification in quotation marks if a plus or minus sign precedes the delta time value.

  • Omit the absolute time value if you want to offset the delta time from the current date and time.

  • Specify date and time information as completely as possible.

The following table shows some examples of combination time specifications:

Time Specification

Result

+5

5 hours from now.

-1

Current time minus 1 hour. The minus sign (-) indicates a negative offset. The 1 is interpreted as an hour, not a day, because it is not followed by a hyphen.

+:5

5 minutes from now.

-:5

Current time minus 5 minutes.

-1-00

Current time minus 1 day. The minus sign (-) indicates a negative offset. The hyphen (-) separates the day from the time field.

31-DEC:+:5

12:05 a.m. on December 31 of the current year. The absolute time specification (before the colon) defaults to midnight on December 31 of the current year. The plus sign (+) indicates a positive offset.

31-DEC:-00:10

11:50 p.m. on December 30 of the current year. The absolute time specification (before the colon) defaults to midnight on December 31 of the current year. The minus sign (-) after DEC: indicates a negative offset.

2.7. Recalling Commands

At the DCL prompt, you can recall previously typed command lines to avoid retyping long command lines. Once a command is displayed, you can reexecute or edit it.

On OpenVMS VAX systems, the recall buffer holds up to 20 previously entered commands.

On OpenVMS Alpha systems, the recall buffer holds up to 254 previously entered commands.

You can display your previously entered commands by using one of the following methods:
  • Pressing Ctrl/B

  • Using up arrow and down arrow keys

  • Using the RECALL command

2.7.1. Pressing Ctrl/B

Pressing Ctrl/B once recalls the previous command line. Pressing Ctrl/B again recalls the line before the previous line and so on to the last saved command line.

2.7.2. Using Arrow Keys

Using the up arrow and down arrow keys recalls the previous and successive command, respectively. Press the arrow keys repeatedly to move through the commands.

2.7.3. Using the RECALL Command

To examine previously typed command lines, type RECALL/ALL. After reviewing the available commands, you can recall a particular command line by typing RECALL and the number of the desired command.

You can also follow RECALL with the first characters of the command line you want to display. RECALL scans the previous command lines (beginning with the most recent one) and Enters the first command line that begins with the characters you typed.

Examples

This is a sample display generated by typing RECALL/ALL:
$ RECALL/ALL

 1 SET DEFAULT DISK2:[MARSHALL]
 2 EDIT ACCOUNTS.COM
 3 PURGE ACCOUNTS.COM
 4 DIRECTORY/FULL ACCOUNTS.COM
 5 COPY ACCOUNTS.COM [.ACCOUNTS]*
 6 SET DEFAULT [.ACCOUNTS]
The following example shows how to recall the fourth command line:
$ RECALL 4

After you press Enter, the system displays the fourth command in the list at the DCL prompt. The RECALL command itself is not placed in the buffer.

The following example shows how to recall a previously entered command, EDIT ACCOUNTS.COM:
$ RECALL E
After you press Enter, the system displays the following command line:
$ EDIT ACCOUNTS.COM

Note

If you are running a utility or an application program that uses OpenVMS screen management software, you can use Ctrl/B and the up arrow and down arrow keys to perform command recall; however, line editing must be enabled. Some utilities that have this feature are Mail, OpenVMS Debugger, Show Cluster, the System Dump Analyzer (SDA), and the EVE editor.

To erase the contents of the recall buffer, enter the RECALL command with the ERASE qualifier. For example:
$ RECALL/ERASE

For security reasons, it is good practice to erase the contents of the recall buffer after you have entered commands that include passwords.

2.8. Editing the DCL Command Line

At the DCL command level, you can use many individual keys and key sequences to change what you type. Although different types of terminals have different operating characteristics, most have standard function keys and keys that can be used with line editors.

To see whether line editing is enabled, enter the SHOW TERMINAL command.

In the following example, line editing is enabled:
$ SHOW TERMINAL

Terminal: _VTA2138:   Device_Type: VT200_Series  Owner: ROHBA
Physical terminal: _TNA2114:
Remote Port Info: Host: 16.32.216.68 Port: 1409

   Input:    9600     LFfill:  0      Width:  80      Parity: None
   Output:   9600     CRfill:  0      Page:   24

Terminal Characteristics:
   Interactive        Echo               Type_ahead         No Escape
   Hostsync           TTsync             Lowercase          Tab
   Wrap               Scope              No Remote          Eightbit
   Broadcast          No Readsync        No Form            Fulldup
   No Modem           No Local_echo      No Autobaud        Hangup
   No Brdcstmbx       No DMA             No Altypeahd       Set_speed
   No Commsync        Line Editing       Overstrike editing No Fallback
   No Dialup          No Secure server   Disconnect         No Pasthru
   No Syspassword     No SIXEL Graphics  No Soft Characters Printer port
   Numeric Keypad     ANSI_CRT           No Regis           No Block_mode
   Advanced_video     Edit_mode          DEC_CRT            DEC_CRT2
   No DEC_CRT3        No DEC_CRT4        No DEC_CRT5        No Ansi_Color
   VMS Style Input

2.8.1. SET TERMINAL Command

You can use the SET TERMINAL command to alter the way in which your terminal edits a DCL command line. By default, changes made with the SET TERMINAL command apply only to the current session. To set the terminal each time you log in, you can include SET TERMINAL commands in your LOGIN.COM file.

To enable line editing, enter the SET TERMINAL/LINE_EDIT command:
$ SET TERMINAL/LINE_EDIT

Insert and Overstrike Modes

You can edit a command line in either insert or overstrike mode. In insert mode, the character you type is inserted to the left of the cursor. In overstrike mode, the character you type overwrites the character indicated by the cursor.

To change editing modes for a single command line, press Ctrl/A (Ctrl/A acts as a toggle). To change edit modes for your session, enter either the SET TERMINAL/INSERT or SET TERMINAL/OVERSTRIKE command.

Text Wrapping

If you use the SET TERMINAL/WRAP command, when you enter more characters than will fit on one line of the screen, the text wraps to the next line. If you use the SET TERMINAL/NOWRAP command, when you enter more characters than will fit on one line of the terminal screen, the last character on the line is typed over.

You can edit only the line where your cursor appears. When text wraps, you cannot use the up arrow key to move the cursor up to edit the previous line. To move the cursor up to the previous line, use the Delete key and delete all the characters in the current line.

2.8.2. Deleting Parts of the Command Line

Pressing the Backspace key moves the cursor backwards and erases the character in that space. If line editing is enabled, you can use Ctrl/U to delete characters from the beginning of the line to the current cursor position. If line editing is not enabled, you can use Ctrl/U to cancel an entire line. The system ignores the line and redisplays the DCL prompt.

2.9. Defining Terminal Keys

A key definition is a string of characters that you assign to a particular terminal key. Use the DEFINE/KEY command. When a key is defined, you can press it instead of typing the string of characters. A key definition usually contains all or part of a command line. Using key definitions, you can customize your keyboard so that you can enter DCL commands with fewer keystrokes. When you press a defined key, the system either displays the command on your terminal or executes the command, depending on whether the command was defined using the /TERMINATE qualifier.

By default, the terminal is set to numeric keypad mode. Use the SET TERMINAL command to redefine the keys on the numeric keypad. For more information, see the descriptions of the SET TERMINAL/APPLICATION_KEYPAD, SET TERMINAL/NONUMERIC, and DEFINE/KEY commands in the VSI OpenVMS DCL Dictionary.

2.10. Key Sequences

In addition to entering DCL commands, you can perform tasks by using specific key sequences. A key sequence is a shortcut or a way to get the system's attention while it is processing another command.

To enter a key sequence, hold down the Ctrl key while you press and release a second key. The following tables organize key sequences by function.
Table 2.1. To Enter DCL Commands

Key Sequence

Function

Ctrl/Z or F10

Signals the end of the file for data entered from the terminal.

Enter

Sends the current line to the system for processing. If you are not already logged in, Enter initiates a login sequence.


Table 2.2. To Interrupt DCL Commands

Key Sequence

Function

Ctrl/T

Momentarily interrupts terminal output to display a line of statistical information about the current process. This display includes your node and user name, the time, the name of the image you are running, and information about system resources used during your current terminal session.

You can also use Ctrl/T to determine whether the system is operating. Ctrl/T does not enter information if the system is temporarily unresponsive or if your terminal is set to NOBROADCAST. To use Ctrl/T, you must first enter the SET CONTROL=T command (in the system login command procedure, in your personal login command procedure, or interactively).

Ctrl/Y, Ctrl/C and F6

Interrupts command processing. You can disable Ctrl/Y with the command SET NOCONTROL=Y.

Under most conditions, Ctrl/Y returns you to the DCL prompt. The program running is still active. You can enter any built-in command then continue the program with the CONTINUE command. Press Ctrl/W to refresh the screen after you enter the CONTINUE command.


Table 2.3. To Recall Commands

Key Sequence

Function

Ctrl/B or up arrow

Recalls up to 20 (VAX) or 254 (Alpha) previously entered commands.

Down arrow

Displays the next line in the recall buffer.


Table 2.4. To Control Cursor Position

Key Sequence

Function

Backspace

Deletes the last character entered.

Ctrl/A and F14

Switches between overstrike and insert mode. The default mode (as set with the SET TERMINAL/LINE_EDITING command) is reset at the beginning of each line.

Ctrl/D and left arrow

Moves the cursor one character to the left.

Ctrl/E

Moves the cursor to the end of the line.

Ctrl/F or right arrow

Moves the cursor one character to the right.

Ctrl/H or F12

Moves the cursor to the beginning of the line.

Ctrl/I or Tab

Moves the cursor to the next tab stop on the terminal. The system provides tab stops at every eighth character position on a line. Tab settings are hardware terminal characteristics that, in general, you can modify. The Tab key also works when line editing is disabled.

Ctrl/J

Deletes the word to the left of the cursor.

Ctrl/K

Advances the current line to the next vertical tab stop.

Ctrl/L

Moves the cursor to the beginning of the next page. This use of Ctrl/L is ignored when line editing is enabled.

Ctrl/R

Repeats the current command line and leaves the cursor positioned where it was when you pressed Ctrl/R.

Ctrl/U

Deletes all text in the current input line that is to the left of the cursor.

Ctrl/V

Turns off some of the line editing function keys. For example, if you press Ctrl/V followed by Ctrl/D, a Ctrl/D is generated instead of the cursor moving left one character. Ctrl/D is a line terminator at DCL level.

When combined with Ctrl/V, characters that are not line terminators have no effect. Examples are Ctrl/H and Ctrl/J. However, certain control keys, such as Ctrl/U, retain their line editing functions.

Ctrl/X

Cancels the current line and deletes data in the type-ahead buffer.

F7, F8, F9, F11

Reserved by VSI.


Table 2.5. To Control Screen Display

Key Sequence

Function

Ctrl/O

Alternately suspends and continues display of output to the terminal. Ctrl/O displays as Output off and Output on.

Ctrl/S

Suspends terminal output until Ctrl/Q is pressed.

Ctrl/Q

Resumes terminal output suspended by Ctrl/S.

Ctrl/W

Refreshes the screen display.

Chapter 3. Storing Information with Files

A file is a system object that contains information. This information can be machine-readable data that the computer understands. It can also be text that you enter and manipulate. The contents of a file might be the text of a document, a program, or a list of addresses. You can examine the contents of a text file by displaying it online or by printing it.

A program, also called an image or an executable image, is a file that contains instructions and data in machine-readable format. Some programs are associated with a DCL command. For example, when you type the DCL command COPY, the system runs the program SYS$SYSTEM:COPY.EXE. Some programs are started by entering the DCL command RUN followed by the program name.

Image files can be supplied by the operating system or by you and usually have the file type .EXE. You cannot examine an image file with the DCL commands TYPE, PRINT, or EDIT because image files do not consist of ASCII characters. Text files contain ASCII characters, which are a standard method of representing the alphabet, punctuation marks, numerals, and other special symbols.

This chapter describes how to create and manipulate files locally, and over a TCP/IP or DECnet for OpenVMS network. It includes information about:
  • Understanding file names and file specifications

  • Using wildcards with file names

  • Other file names

  • Creating and modifying files

  • Displaying the contents of files

  • Deleting files

  • Protecting files from other users

  • Printing files

For additional information, refer to the following:
  • Chapter 5, Extended File Specifications, for information about file names in an environment using extended file specifications

  • The VSI OpenVMS DCL Dictionary and online help, for commands discussed in this chapter

  • The VSI OpenVMS System Manager's Manual, for information about accessing remote nodes

  • The VSI TCP/IP Services for OpenVMS User's Guide, for information about using TCP/IP user utilities and commands

  • The VSI OpenVMS DECnet Networking Manual, for information about DECnet networks

  • The VSI DECnet-Plus for OpenVMS Introduction and User's Guide, for information about DECnet Phase V networks

3.1. Understanding File Names and File Specifications

A file is a unit that the OpenVMS operating system uses to store human-readable and machine-readable data. When you create or name a file, you provide information the system can use to locate and identify the file.

A filename consists of a file name and a file type. The name and type are separated by a period (.). A file also has a version number. You can have several versions of a file. Unless you specify a version number, the system uses the highest existing version number of a file. When you edit a file, the system does not modify the original version, but creates a new output file. By default, the output file has the same name and file type as the original, but has a version number that is one higher than the existing file(s) of the same name.

The file name, file type, and version number form a file specification.

3.1.1. Providing a Complete File Specification

A file is located on a specific computer (or node) in the network, on a specific device or set of devices (known as a volume) connected to that computer, in a particular directory on that volume. A complete file specification:
  • Precisely describes the access path the system uses to locate and identify a file

  • Can include the directory in which the file is located and the network node on which the file resides

  • Is also known as a network file specification

You do not have to include all the elements of a complete file specification. However, you must specify enough of the file specification so that, when combined with default components, the system can locate and identify the correct file?.

To override system defaults or to perform file operations over a network, you must provide a complete file specification. A complete file specification has the following format:
node::device:[root.][directory]file-name.file-type;version
The components are as follows:

Node

A network node or host name; applicable only to systems that support TCP/IP or DECnet. Does not apply to files stored on magnetic tape. Should not be used to specify a file on the same system that you are logged in to.

Device

The term used to refer to a disk or tape drive or other peripheral connected to a computer running the OpenVMS operating system. Each device has a unique name that indicates its type and location. Disks can be formatted as ODS-2 (the default) or ODS-5 (OpenVMS Alpha only).

Directory

The name of the directory in which a file is stored. Square brackets ([]) or angle brackets (<>) are used to delimit directories. Directories do not apply to files stored on magnetic tape.

File name

The name of the file.

File type

Identifies the structure or the type of the file.

Version

The version number of the file. Versions are identified by a decimal integer number, which is incremented by 1 each time a new version of the file is created. The system automatically assigns a version number unless you specify one.

3.1.2. Rules for File Specifications

Use the following rules to specify the elements of a file specification:
  • Give the file a name that is meaningful to you. On OpenVMS systems with ODS-2 disks, the file name can have up to 39 characters chosen from the letters A to Z (uppercase or lowercase), the numbers 0 to 9, underscores (_), hyphens (-), tildes (~), and dollar signs ($).

    On OpenVMS systems with ODS-5 disks, the combined length of the file name and file extension, including the dot between them, can be up to 236 characters from the ISO Latin-1 character set (some may require the ^ escape character), except the asterisk (*) and the question mark (?). For more information, see the VSI OpenVMS Guide to Extended File Specifications.

  • Do not use a hyphen as the first character in the file name because some older versions of OpenVMS do not allow it in all forms of a file specification.

  • The file type begins with a period (.). On OpenVMS systems with ODS-2 disks, the file type can have up to 39 characters (including the period), chosen from the letters A through Z (which may be specified in uppercase or lowercase form), the numbers 0 through 9, underscores (_), hyphens (-), and dollar signs ($).

    As stated here, on OpenVMS systems with ODS-5 disks, the length of the file name and file extension combined can be up to 236 characters from the ISO Latin-1 character set.

  • A version component begins with a semicolon (;) or a period (.). When the system displays file specifications, it displays a semicolon for the version component.

  • Do not use a directory field to refer to files on magnetic tape. Directories apply only to files on disks.

  • Include a node name only if your system is part of a network and if the file is on a node other than the one you are logged in to.

  • On OpenVMS systems with ODS-2 disks, a UFD (User File Directory) name or a subdirectory name can be 39 characters long and can contain characters chosen from the letters A through Z (which may be specified in uppercase or lowercase form), the numbers 0 through 9, underscores (_), hyphens (-), and dollar signs ($). A subdirectory name beginning with a hyphen is not allowed.

    On OpenVMS system with ODS-5 disks, the directory name (which includes the four characters in the .dir file extension) can be up to 236 characters long and can contain characters chosen from the ISO Latin-1 character set, similar to the file name. See the VSI OpenVMS Guide to Extended File Specifications for more information.

  • On OpenVMS Alpha Version 7.2 or later, the sum of the numbers of characters in all of the subdirectories of the directory and root components (not including brackets and separator periods) should not exceed 512. In addition, UFD and subdirectory names have the same constraints as those for the file name, type, and version components, taking into account the fact that directories are stored as files of the form <directory-name>.DIR;1.

  • In environments that consist of systems that support extended file specifications and systems that do not, remember that files and directories whose names are beyond the capabilities of the more limited systems will not be accessible from those systems.

For more details, refer to the VSI OpenVMS Guide to OpenVMS File Applications.

Note

Environments with extended file specifications have more benefits than just longer file names and larger character sets. Refer to Chapter 5, Extended File Specifications for more specific information about extended file names.

3.1.3. Default File Types Used by DCL Commands

With certain commands, if you omit the file type, the system applies a default value. The following table lists some of the more common default file types used by DCL commands:

File Type

Contents

.CLD

Command description file

.COM

Command procedure file

.DAT

Data file

.DIF

Output file created by the DIFFERENCES command

.DIR

Directory file

.DIS

Distribution list file for the Mail utility

.EXE

Executable program image file created by the linker

.HLB

Help text library file

.HLP

Input source file for help libraries

.INI

Initialization file

.LIS

Listing file created by a language compiler or assembler; default input file for the PRINT and TYPE commands

.LOG

Batch job output file

.MAI

Mail message file

.PS

PostScript format file

.SYS

System image file

.TJL

Journal file created by the DECTPU and ACL editors

.TLB

Text library file

.TMP

Temporary file

.TPU

Command file for the EVE editor

.TPU$JOURNAL

Journal file created by the EVE editor

.TXT

Input file for text libraries or Mail utility output files

3.1.4. Default File Types for Language Source Programs

The following table lists the default file types for some high-level language source programs:

File Type

Contents

.ADA

Input source file for the VSI Ada compiler

.BAS

Input source file for the BASIC compiler

.B32

Input source file for the VAX BLISS-32 compiler

.C

Input source file for the VSI C compiler

.COB

Input source file for the VAX COBOL compiler

.FOR

Input source file for VSI Fortran compiler

.M64

Input source file for the MACRO-64 assembler

.MAP

Memory allocation map created by the Linker utility

.MAR

Input source file for the VAX MACRO-32 assembler

.MLB

Macro library for the MACRO assembler

.MSG

Source file that specifies the text of messages

.OBJ

Object file created by a language compiler or assembler

.OLB

Object module library

.OPT

Options file for input to the LINK command

.PAS

Input source file for the Pascal compiler

.PLI

Input source file for the PL/I compiler

.STB

Symbol table file created by the Linker utility

.UPD

Update file of changes for a VAX MACRO source program; also input to the SUMSLP utility

3.1.5. File Versions

In addition to a file name and file type, every file has a version number. Version numbers are decimal integer numbers from 1 to 32,767 that differentiate versions of a file. When you create a file, the system assigns it the version number 1.

You can have several versions of the same file. Unless you specify a version number, the system uses the highest existing version number of that file. If you specify the version number 0, the system uses the highest existing version. When you modify a file with a command, application, or text editor (such as EVE) that creates a new version of the file, the file name remains the same but the version number is incremented by one.

Precede version numbers with a semicolon or a period. When the system displays file specifications, it displays a semicolon in front of the file version number.

You can refer to versions of a file in a relative manner by specifying a zero or a negative version number. Specifying zero locates the latest (highest numbered) version of the file. Specifying −1 locates the next-most-recent version, −2 the version before that, and so on. To locate the earliest (lowest numbered) version of a file, specify −0 as the version number. Note that you cannot create files with a version number higher than 32767. If you attempt to create a new file with a version number higher than 32767, you will receive an error message.

The /VERSION_LIMIT[=n] qualifier for the CREATE/DIRECTORY, SET DIRECTORY, and SET FILE commands lets you set the maximum number of versions that a specified file or all files in a directory can have. When creating a file, if the total number of versions of that file name exceeds the specified version limit, then the file with the lowest version number is deleted from the directory without notification to the user. For example, if the version limit is 5 and you create the sixth version of a file (ACCOUNTS.DAT;6), the system deletes the first version of the file (ACCOUNTS.DAT;1). To view the version limit on a file, use the DIRECTORY/FULL command on a file name and look at the File Attributes field of the output or use the F$FILE_ATTRIBUTES(filename,"VERLIMIT") lexical function. For detailed information, refer to the VSI OpenVMS DCL Dictionary.

3.1.6. Network Node Names

An OpenVMS node is an individual machine (hardware or virtual) with the OpenVMS operating system installed on it. In a network, the node that you log in on is known as your local node; other nodes in the network are remote nodes. You have to use the node name when you want to specify a file on a remote node.

A node specification has the following format:
node["access-control-string"]::
Observe the following rules when entering a node name as part of a file specification:
  • Node names can contain 1 to 6 alphanumeric characters and must contain at least one alphabetic character. For example:
    • AFTP1
    • F2OTR2
    • MYNODE
  • A node name (with or without an access control string) must always be followed by a double colon (::).

  • When you specify a node name, you can include a 0- to 42-character access control string. An access control string contains login information to be sent to the remote node. For more information on access control strings, see Section 3.1.12, “Access Control String Format”.

    Note that the required double colon follows the access control string.

  • You can use a logical name in place of the node name. For information on logical node names, see Chapter 11, Defining Logical Names for Devices and Files.

3.1.7. Specifying DECnet-Plus Node Full Names

On OpenVMS systems, you can specify node full names. However, you must have DECnet–Plus software installed for full node names to be recognized.

Valid full node names can contain up to 255 characters and can include any characters except the following:
  • Spaces

  • Tabs

  • The characters: comma (,), quotation marks ( ), slash (/), exclamation point (!), equal sign (=), plus sign (+), at sign (@), apostrophe ('), parentheses (( )), and double colons (::)

  • A single colon (:) as the first or last character

If a full node name is enclosed in quotation marks ( ), it can contain any characters except unmatched quotation marks. Note that if there are quotation marks within the node name, the quotation marks must be doubled and the entire string, including the quotation marks, must also be enclosed in quotation marks.

Although the OpenVMS software enforces few rules on the syntax of node names, the actual set of valid node names is constrained by the DECnet software running on your system. For further information on full names, refer to the DECnet–Plus documentation. The syntax rules, including valid character codes, are described in detail in the VSI DECnet-Plus for OpenVMS DECdns Management Guide.

In the following example, the entire string is in quotation marks because there are quotation marks in the node name:
"MARY:.UNIVERSITY.""SCIENCE LAB"""
Other examples of valid full node names are:
  • MYNODE
  • MASSACHUSETTS:.BUSINESS.YOURNODE
  • A.B;C

3.1.8. Specifying TCP/IP Names and Addresses

With TCP/IP, unless otherwise stated, whenever you specify a host on a command line, you can use its host name, a fully qualified domain name, or its IP address. The relative name of a host is a simple name that does not include the fully qualified domain name; that is, it does not include one or more periods (.). Refer to the VSI TCP/IP Services for OpenVMS User's Guide for the TCP/IP syntax rules.

3.1.9. Accessing Files on Remote Nodes Using DECnet

When you access a file on a remote node, DECnet logs in at the remote node. To do this, the system needs login information for that node. You can supply the system with an access control string. If you omit the access control string, the login information sent to the remote node is determined as follows:
  • If a proxy login account exists for you on the remote node, then the system logs you in using that account. A proxy login account allows selected users to log in to a node.

  • If a proxy login account does not exist, the system uses the default DECnet account for that node as specified by the local system manager.

If you include an access control string, the system uses it to log you in to the remote node. The remainder of the file specification is passed to the remote node and is interpreted there.

If you specify a local node as part of a file specification, the system logs you in over the network to perform the file operation, even though the file exists on your local node. For information about additional ways to access remote systems, see the VSI OpenVMS System Manager's Manual.

Note

Throughout the remainder of this chapter, examples that specify a node name do not always include an access control string. This is because proxy accounts enable users to perform operations on the remote systems in these examples.

3.1.10. Accessing Files on Remote Nodes Using TCP/IP

VSI TCP/IP Services for OpenVMS provides the File Transfer Protocol (FTP) to access and transfer files to and from another host over a network. To use FTP, you need a user account on the OpenVMS system with access to VSI TCP/IP Services for OpenVMS and a user account on the remote FTP host. In some instances, TCP/IP allows you to connect to a remote host without specifying an account and password. If that feature is not enabled, you must supply user authentication information for a remote host. For information on using FTP commands, refer to the VSI TCP/IP Services for OpenVMS User's Guide.

3.1.11. Using Network File Specifications

There are three formats for network file specifications:
  • Conventional

  • Foreign

  • Task

In each format, the node specification can include an access control string. For more information, see the DECnet User's Manual for your product and the VSI TCP/IP Services for OpenVMS User's Guide.

3.1.11.1. Conventional File Specification

The conventional format for files is:
node::device:[directory]filename.type;version

3.1.11.2. Foreign File Specification

A foreign file specification is a file that does not conform to OpenVMS syntax. The format used to provide a foreign file specification is:
node::"foreign-file-spec-string"
In the following example, this file name contains a question mark (?), which is not recognized as a valid file name character. Therefore, the file name must be enclosed in quotation marks ( ). It must also be in a format that is recognized by the operating system of the remote node you are accessing:
$ COPY BOSTON::"TEST?.DAT" *

3.1.11.3. Task Specification Strings

A task specification string identifies a program to be executed on the remote node. You can use task specification strings within a program to enable the program to communicate with another program on a remote node. The format used to indicate a task specification string is:
node::task-spec-string
This specification identifies the program TEST2 on the remote node BOSTON:
BOSTON::"TASK=TEST2"

Note

There are some restrictions when you copy files to or from a UNIX system. For more information, see the VSI OpenVMS Record Management Utilities Reference Manual.

3.1.12. Access Control String Format

Access control strings designate accounts that you can log in to on remote nodes. Node names with access control strings have the following format:
node"access-control-string"::

Enclose the access control string in quotation marks ( ) and follow it with a double colon (::).

On OpenVMS systems, the access control string consists of a user name, followed by one or more spaces or tabs and a password. For additional information on access control strings, see Chapter 10, Controlling Access to Resources.

In the following example, BOSTON is the network node name. "HIGGINS ETUHCARAP" is an access control string where:
  • HIGGINS is a user name on the node BOSTON.

  • ETUHCARAP is the password associated with that name:


$ DIR BOSTON"HIGGINS ETUHCARAP"::WEASEL2:[BORIS]ACCOUNTS.DAT

3.2. Using Wildcards with File Names

Use wildcard characters to apply a DCL command to multiple files rather than to one file at a time. The command applies to all files that match the portion of the file specification entered.

Many examples in this chapter show the use of wildcard characters in file operations. The use of wildcard characters in DCL commands varies with the individual command.

There are two wildcards available for use with many DCL commands: asterisks (*) and percent signs (%). Both can be used as wildcard characters in directory names, file names, and file types. See Section 4.5, “Using Wildcards to Search the Directory Structure” for information about wildcards used with directories. In version components, you can use an asterisk (;*), but not a percent sign or a mix of wildcards and numerals.

On Alpha systems running OpenVMS Version 7.2 or greater, the question mark (?) can be used in place of the percent sign (%).

If you are working in an environment with extended file specifications, refer to Chapter 5, Extended File Specifications for information about additional wildcard options.

3.2.1. Asterisk (*) Wildcard Character

Use the asterisk (*) wildcard character to match the following:
  • An entire field (or a portion of it) in the directory, file name, and file type fields

  • The entire version number field, but not a portion of it

You can use the asterisk (*) wildcard character as follows:
  • To manipulate large numbers of files without naming them individually

  • To limit the files selected to a more specific group

  • In directory specifications

Examples

In the following example, the file specification selects all versions of all files in the [FROGMAN] directory:
$ PRINT [FROGMAN]*.*;*
In the following example, only those files in the current default directory with the file type .DAT are displayed:
$ TYPE *.DAT;*
The command in this example selects all files with the file type .DAT that exist in subdirectories one level below [FROGMAN]:
$ DIRECTORY [FROGMAN.*]*.DAT
In the following example, the wildcard characters appear in the directory specification:
$ TYPE [*.*.*]AVERAGE.*;*

This file specification selects all versions of all files named AVERAGE with any file type that exists in any second-level subdirectory on the current default disk. For example, this file specification selects [A.B.C]AVERAGE.DAT but not [X.Y]AVERAGE.DAT.

3.2.2. Percent Sign (%) Wildcard Character

Use the percent sign (%) wildcard character as a substitute for any single character in a file specification. You can use the percent sign in the directory, file name, and file type fields. You cannot, however, use the percent sign in the version number field or in ANSI magnetic tape file specifications. The percent sign replaces one character position in a field, but there must be a character to replace.

You can specify the percent sign as many times as necessary and in combination with other wildcard characters.

The following example displays the latest versions of all .DAT files whose names are DISTRICT followed by a single character:
$ TYPE [JONES.TAXES.PROPERTY]DISTRICT%.DAT

This display would include the files DISTRICT1.DAT, DISTRICT2.DAT, and DISTRICT3.DAT. The file DISTRICT4_5.DAT would not be displayed because it has more than one character after DISTRICT, nor would the file DISTRICT.DAT be displayed.

The file specification in this example is valid:
$ [MA*]INS%%%A*.J*;*

3.3. Other File Names

The following sections describe other types of file names supported in an OpenVMS environment.

3.3.1. Null File Names and File Types

When a file specification component, such as the file name or the file type, is missing, it is often replaced by a default value during the (built-in) parsing operation of the DCL command or utility. For example, the FORTRAN command uses a default file type or .FOR. The following command would cause the FORTRAN compiler to attempt to compile the file FILE.FOR:

$ FORTRAN FILE
Also, the DIRECTORY command replaces any missing components with an asterisk wildcard. For example, the following command would display all files with the file name FILE, no matter what file type (including a period (.)):
$ DIRECTORY FILE
A file can have a name that is null (null value or have a file type that consists of only the delimiter period (which is sometimes referred to as a null file type). For example, the following are valid file names:
.TMP
TEMP.

3.3.1.1. File References with Null File Types

You can make a reference to a file with a type that consists of only the delimiter period, as follows:
$ DIRECTORY TEMP.         !

Because there is no file name delimiter, it is not possible to make a reference to a file with a null file name. A file reference with no file name will always be interpreted as having a missing file name.

The following command will display a list of all files with the type .TMP rather than only the file .TMP because the directory utility will automatically replace the missing file name with "*".
$ DIRECTORY .TMP

3.3.2. Alternate File Names for Magnetic Tapes

In addition to standard (ODS-2 compatible) file names, the operating system supports an alternate file-naming convention for ANSI-labeled magnetic tapes. The format is as follows:
"filename".;version
The file name can contain 1 to 17 characters from the ASCII "a" character set. This set of characters includes numeric characters, uppercase letters, and a space, as well as the following characters:
! " % ' ( ) * + , - . / : ; < = > ? & _

In addition, asterisk (*) character is allowed in ANSI magnetic tape file names.

For details, refer to the VSI OpenVMS Guide to OpenVMS File Applications.

3.4. Creating and Modifying Files

The following sections describe how to create and modify files with tools and commands supported in an OpenVMS environment.

You can create and modify text files with an interactive text editor. EVE and EDT are two text editors included in the OpenVMS operating system; other text editors may also be available on your system.

You can also create and modify files by using the DCL commands CREATE, COPY, and RENAME. The following sections describe how to create and modify files using these commands.

If you are working in an environment with extended file specifications, refer to Chapter 5, Extended File Specifications for further information about creating and copying files in your environment.

3.4.1. Creating Files

The CREATE command creates a text file. You cannot modify a file with the CREATE command; after you have pressed Enter, you cannot return to a previous line to modify a word. You must use a text editor to modify a file created with the CREATE command. Pressing Ctrl/Z signals the end of the file and returns you to DCL command level.

In the following example, a file named TEST.TXT is created by entering the CREATE command and then typing lines of text:
$ CREATE TEST.TXT
this is a test
12345678
Ctrl/Z

3.4.2. Copying Files

You can use the COPY command to duplicate:
  • The contents of an existing file in a new file

  • Many files at a time

  • Only those files that meet specified criterion by using the /SINCE qualifier with the COPY command

Examples

In the following example, the file FEES.DAT is copied to RECORDS.DAT:
$ COPY FEES.DAT RECORDS.DAT
In the following example, all .TXT files in the default directory are copied to another directory:
$ COPY *.TXT;* [SAVETEXT]*.*;*
In the following example, only those files in the directory [JONES.LICENSES.DOG] that have been modified since December 11, 1999 are copied to the default directory:
$ COPY/SINCE=11-DEC-1999/MODIFIED [JONES.LICENSES.DOG]*.* *

3.4.3. File Concatenation

The COPY command can also be used to concatenate files. For example, to append FEES1.DAT to FEES.DAT (forming a new version of FEES.DAT) in your default directory, enter the following command:
$ COPY FEES.DAT,FEES1.DAT FEES.DAT

Note that there is no space between the comma after FEES.DAT and the file name FEES1.DAT.

3.4.4. Copying Files from a Remote Node to Your Node Using DECnet

Use the COPY command to copy files from another node to your node. For example, to copy the latest version of all files in the directory DISK2:[PUBLIC] on node CHAOS to files with the same names in your default directory, enter the following command:
$ COPY CHAOS::DISK2:[PUBLIC]*.*  *

3.4.5. Copying Files from Your Node to a Remote Node Using DECnet

Use the COPY command to copy files from your node to another node. If you receive a protection violation or DECnet error message when you attempt to copy a file across systems, you can either use mail to copy the file or you can use an access control string.

In the following example, the latest version of all files in the default directory are copied to files with the same names in the directory DISK2:[STAFF_BACKUP] on node CHAOS:
$ COPY *.* CHAOS::DISK2:[STAFF_BACKUP]

3.4.6. Copying Files on Remote Systems Using TCP/IP

TCP/IP uses the File Transfer Protocol (FTP) service to access and transfer files to and from another host over a network. To copy files from a remote host to your local host, use the GET command. To copy files from your local host to a remote host, use the PUT command. To use these commands, you must have an active FTP session with a remote host. You can enter any number of FTP commands during the session. For information on using FTP commands, refer to the VSI TCP/IP Services for OpenVMS User's Guide.

In the following example, the file FEES.DAT is sent to the JONES account on node CHAOS:
$ MAIL/SUBJECT="Fee schedule"  FEES.DAT  CHAOS::JONES

3.4.7. Using Access Control Strings to Copy Files

To copy files after you have received a protection violation, you can follow the node name in the file specification with an access control string (see Section 3.1.12, “Access Control String Format”).

In the following example, the user has an account on node CHAOS with the user name SMITH and the password SPG96PRT. The user is copying the latest version of all files in the default directory to the account on CHAOS.
$ COPY *.* CHAOS"SMITH SPG96PRT"::DISK2:[STAFF_BACKUP]

3.4.8. Renaming Files

Use the RENAME command to give the file a new name and optionally to locate it in a different directory. Note that after being renamed, the original file no longer exists. When you use the RENAME command, the input and output locations must be on the same device.

In the following example, the file FEES.DAT is given the new name RECORDS.DAT and it is moved from the default directory to the [SAVETEXT] directory:
$ RENAME FEES.DAT;4 [SAVETEXT]RECORDS.DAT

3.5. Displaying the Contents of Files

The following sections describe how to display the contents of files with tools and commands supported in an OpenVMS environment.

3.5.1. Using the TYPE Command

To display the contents of a file on your screen, enter the TYPE command and the file name at the DCL prompt. You do not have to specify the version number in the file specification because the system displays the latest version of a file by default.

In the following example, the latest version of the file STAFF_VACATIONS.TXT is displayed:
$ TYPE STAFF_VACATIONS.TXT

3.5.2. Controlling the Display

If you specify the /PAGE qualifier to the TYPE command, you can view one screen at a time. The system prompts you to press Enter when you want to see the next screen.

By invoking an interactive text editor (for example, EVE or EDT) with the /READ_ONLY qualifier, you can use interactive editing commands to move around in a file and search for specific sequences of characters. The /READ_ONLY qualifier prevents you from creating a modified version of the file when you exit from the interactive editor.

3.5.3. Displaying Files on Remote Nodes

When using DECnet to display the contents of a file on a remote node, include the node name, disk, and directory in the file specification.

In the following example, the file COMPANY_HOLIDAYS.TXT (which is located on remote node CHAOS) is displayed:
$ TYPE CHAOS::DISK2:[PUBLIC]COMPANY_HOLIDAYS.TXT

When using TCP/IP to display the contents of a file on a remote node, use the FTP VIEW command, and specify the file name. If the file is not in your current working directory, include the directory name in the file specification. Refer to the VSI TCP/IP Services for OpenVMS User's Guide for information on the FTP VIEW command.

3.5.4. Displaying Files with Wildcards

You can use the asterisk (*) wildcard to display all versions of a specific file.

In the following example, all versions of the file LOGIN.COM in the directory [JONES] are displayed:
$ TYPE [JONES]LOGIN.COM;*
In the following example, all versions and all file types of all files that begin with the word STAFF in the directory [JONES] are displayed:
$ TYPE [JONES]STAFF*.*;*

3.5.5. Displaying Multiple Files

If you specify more than one file in the TYPE command line, the system displays the files in the order you specify. If you use wildcard characters, the system displays the files in alphabetical order.

3.6. Deleting Files

The DELETE command removes files from directories and releases the disk space they occupy for use by other files. When you use the DELETE command, you must specify a version number or the asterisk (*) wildcard character as a version number in each file specification.

For example, to delete version 17 of the file POUND.LIS, enter the following command:
$ DELETE POUND.LIS;17
To delete versions 16 and 17 of the file POUND.LIS, enter the following command:
$ DELETE POUND.LIS;16,;17
To delete all versions of the file POUND.LIS, enter the following command:
$ DELETE POUND.LIS;*

When you delete many files with wildcard characters, you might want to confirm each deletion by using the /CONFIRM qualifier. Similarly, you might want to display the names of files as they are deleted. To do this, specify the /LOG qualifier with the DELETE command.

In the following example, the deletion of all the files in the subdirectory [JONES.LICENSES.DOG] is confirmed because the /CONFIRM qualifier is specified:
$ DELETE/CONFIRM *.*;*
DISK1:[JONES.LICENSES.DOG]FEES.DAT;4, delete? [N]: Y
DISK1:[JONES.LICENSES.DOG]FEMALE.LIS;6, delete? [N]: Y
DISK1:[JONES.LICENSES.DOG]MALE.LIS;3, delete? [N]: N
DISK1:[JONES.LICENSES.DOG]POUND.LIS;17, delete? [N]: Y
In the following example, the system displays the names of the files after they are deleted because the /LOG qualifier is specified:
$ DELETE/LOG *.LIS;*
_%DELETE-I-FILDEL, DISK1:[JONES.LICENSES.DOG]FEMALE.LIS;6 deleted (35 blocks)
_%DELETE-I-FILDEL, DISK1:[JONES.LICENSES.DOG]MALE.LIS;3 deleted (5 blocks)
_%DELETE-I-FILDEL, DISK1:[JONES.LICENSES.DOG]POUND.LIS;17 deleted (9 blocks)

3.6.1. Using the PURGE Command

The PURGE command deletes all except the latest version of the specified file (or all files) in the default directory or any other specified directory. Purging old versions of files after updating them enables you to retain more free space on your disk.

In the following example, all except the latest two versions of each file in the default directory are purged:
$ PURGE/KEEP=2

3.7. Protecting Files from Other Users

The following sections provide an overview of file protection procedures. For detailed security information, see the following:

3.7.1. Access Control Lists (ACLs)

To prevent other users from accessing your files, you can change the protection or modify the access control list (ACL) of your files. To change the protection or modify the ACL of a file, you must own the file, have control access to the file, or have GRPPRV, SYSPRV, BYPASS, or READALL privilege.

3.7.2. Types of Protection

There are two types of file protection: default and explicit. When a file is created, it usually has the same protections as its parent directory; this is the default protection. If you create a file using the CREATE/PROTECTION command or if you change the protection on an existing file by issuing the SET SECURITY/PROTECTION command, you are using explicit file protection.

Note that to protect a file completely, you must apply the same or greater protection to the directory in which the file resides.

Chapter 4. Organizing Files with Directories

A directory is a special kind of file that contains the names and locations of files. For example, when the system manager creates a user account for you, a directory will also be created, often with the same name as your username. If your user name is JONES, the directory would be [JONES].

A subdirectory is a directory file within another directory or subdirectory file. Subdirectories let you organize files into meaningful groups. For example, you might have one subdirectory that contains memos and another subdirectory for status reports.

Like a directory, a subdirectory contains names and pointers for the files cataloged within it. A subdirectory can contain an entry for another subdirectory, which can contain an entry for another subdirectory, and so on. This structure (a top-level directory plus subdirectories) is called a hierarchical directory structure.

The files you commonly access are stored on disks. Each disk contains a main directory, known as the master file directory (MFD). The MFD contains a list of user file directories (UFDs). A UFD is referred to as a user's top-level directory. In most cases, a UFD exists for each user on the system. It contains the names of and pointers to files cataloged in a user's directory. Your top-level directory is usually your process default directory. Unless your account has been modified to do otherwise, the system automatically makes your top-level directory your process-default directory when you log in.

The device (disk) and directory components of a complete file specification are often referred to as the file path. The path, combined with the file name and file type (and version) form a complete file specification. A complete file specification contains all of the information that the system needs to locate and identify a file?.

Refer to the VSI OpenVMS Guide to OpenVMS File Applications for more information about how the system applies defaults to partial file specifications.

This chapter describes how to use directories to organize and manage files. It includes information about:
  • Directory structures

  • Understanding directories

  • Defaults

  • Protecting directories from other users

  • Using wildcards to search the directory structure

  • Working with directories in UIC format


Note

Throughout this chapter, examples that specify a node name do not always include an access control string. This is because proxy accounts enable users to perform operations on the remote systems in these examples.

If you are working in an environment with extended file specifications, directory structures and syntax may differ from the traditional structures described here. For information about working with directories in such an environment, refer to Chapter 5, Extended File Specifications.

4.1. Directory Structures

Figure 4.1, “Directory Structure” shows a sample directory hierarchy. At the top of the structure is the master file directory (MFD). Its directory name is [000000]. The MFD shown contains entries for user file directories including MARTINO.DIR, PUBLIC.DIR, and JONES.DIR. The top-level directory [JONES] is a user file directory named JONES.DIR;1 in [000000].

The sample directory structure in Figure 4.1, “Directory Structure” is the basis for many of the examples in this chapter.

Figure 4.1. Directory Structure
Directory Structure
Note the following about this directory structure:
  • Assume that you are user JONES. When you log in, the system places you in [JONES], your default directory.

  • [JONES] contains the following four nondirectory files:
    • LOGIN.COM;3
    • LOGIN.COM;4
    • STAFF.DIS;3
    • STAFF_VACATIONS.TXT;2
  • [JONES] also contains the following two directory files:
    • LICENSES.DIR;1
    • TAXES.DIR;1
  • The directory file LICENSES.DIR;1 points to the [JONES.LICENSES] subdirectory.

  • TAXES.DIR;1 points to the [JONES.TAXES] subdirectory.

  • The [JONES.LICENSES] subdirectory contains three nondirectory files and two directory files.

  • The directory file DOG.DIR;1 points to the [JONES.LICENSES.DOG] subdirectory.

  • MARRIAGE.DIR points to the [JONES.LICENSES.MARRIAGE] subdirectory.

4.2. Understanding Directories

The directory component of a file specification consists of a top-level directory name (such as a UFD) that can be followed by a number of subdirectory names. Subdirectory names are separated by periods (.).

Versions of OpenVMS Alpha prior to Version 7.2 and all versions of OpenVMS VAX support directory components that contain the UFD and no more than seven subdirectory names. OpenVMS Alpha Version 7.2 or later supports 255 names (UFD plus subdirectories) in a directory component.

A directory specification has the following format:
[directory.subdirectory]

To add one or more levels of subdirectories, add a period and another subdirectory name for each subdirectory (up to the limit). A subdirectory of another subdirectory is specified by concatenating the subdirectory name (with the preceding period) to the name of the subdirectory one level above it in the hierarchy.

On versions prior to OpenVMS Alpha Version 7.2, on any version of OpenVMS VAX, and on OpenVMS Alpha systems using ODS-2 disks, a subdirectory name can contain no more than 39 characters.

On OpenVMS Alpha Version 7.2 or later with ODS-5 disks, subdirectory names are limited by the filename limit since subdirectory files are stored as <subdirectory-name>.DIR;1. The total number of characters within the directory and root components of a file specification (excluding delimiter brackets and periods) should not exceed 512.

4.2.1. Creating Directories

To create a directory, enter the CREATE/DIRECTORY command. If you want to create a subdirectory under your current directory, you do not have to specify the current directory name; you can enter the subdirectory name preceded by a period.

In the following example, the directory [JONES.TAXES] is created:
$ CREATE/DIRECTORY [JONES.TAXES]
In the following example, the current default directory is [JONES], and the subdirectory [JONES.LICENSES] is created:
$ CREATE/DIRECTORY [.LICENSES]

4.2.2. Displaying Directories

To display the names of files in a directory, enter DIRECTORY at the DCL prompt. To list the files in a subdirectory, enter the DIRECTORY command and the subdirectory name preceded by a period.

When you include certain command qualifiers along with the DIRECTORY command, you can retrieve information in addition to the names of the files. For more information on DIRECTORY command qualifiers, refer to the VSI OpenVMS DCL Dictionary or online help.

In the following example, the files in the directory [JONES] are listed. The example shows that [JONES] contains two subdirectories, [JONES.LICENSES] and [JONES.TAXES], four nondirectory files, STAFF.DIS, STAFF_VACATIONS.TXT, and two versions of LOGIN.COM:
$ DIRECTORY

Directory DISK1:[JONES]

LICENSES.DIR;1
LOGIN.COM;3
LOGIN.COM;4
STAFF.DIS;3
STAFF_VACATIONS.TXT;2
TAXES.DIR;1

Total of 6 files.
In the following example, the default directory remains [JONES] and the contents of the subdirectory [JONES.LICENSES] are displayed:
$ DIRECTORY [.LICENSES]

Directory DISK1:[JONES.LICENSES]

DEPT.DAT;3
DOG.DIR;1
MAILING.LIS;6
MARRIAGE.DIR;1
TOTAL.DAT;2

Total of 5 files.

4.2.3. Deleting Directories

To delete a directory, use the following procedure:
Step

Task

1

Make sure that the directory contains no files. To find out if the directory contains files, enter the DIRECTORY command.

When there are no files in the directory, the system displays the following message:
%DIRECT-W-NOFILES, no files found
2

If the directory contains files, copy them to another directory to save them or delete them if you do not want to save them. If the directory contains subdirectories, examine those subdirectories, copy or delete their files, and delete the subdirectories.

3

Move to the directory one level above the directory you want to delete. Remember that subdirectories exist as files in directories. When you delete a directory, you delete the file that points to that directory.

4

Change the file protection of a directory to allow delete access to the file. Directory files in master file directories require SYSPRV privilege to delete. See Chapter 3, Storing Information with Files for more information about file protection.

5

Delete the directory file using the DELETE command.

The following example shows how to delete the subdirectory [JONES.LICENSES]:
$ SET DEFAULT [JONES.LICENSES]
$ DIRECTORY
%DIRECT-W-NOFILES, no files found
$ SET DEFAULT [JONES]
$ SET SECURITY/PROTECTION=OWNER:D LICENSES.DIR
$ DELETE LICENSES.DIR;1

4.3. Setting Defaults

To change your default directory, use the SET DEFAULT command. The new default remains in effect until you enter another SET DEFAULT command or log out. To set default to a subdirectory, append the subdirectory name to the name of the directory one level above it.

In the following example, default is set to the directory [JONES] and then the file [JONES]STAFF_VACATIONS.TXT is displayed:
$ SET DEFAULT [JONES]
$ TYPE STAFF_VACATIONS.TXT
In the following example, the file BILLING.DAT, which is located in the subdirectory [JONES.TAXES], is displayed:
$ SET DEFAULT [JONES.TAXES]
$ TYPE BILLING.DAT

4.3.1. Setting Default to Nonexistent Directories

Note that the operating system allows you to set default to a nonexistent disk or directory. If you have set default to a nonexistent directory, when you try to manipulate a file, the system displays a message stating that the directory does not exist. If you find yourself in a nonexistent disk or directory and cannot carry out a desired operation, set default to an existing disk or directory.

4.3.2. SHOW DEFAULT Command

To display your current default directory, enter the command SHOW DEFAULT, as shown in the following example:
$ SHOW DEFAULT
  DISK1:[JONES.TAXES]
$ SET DEFAULT [PUBLIC]
$ SHOW DEFAULT
  DISK1:[PUBLIC]

You can use the SET DEFAULT command to change the default device. The default remains in effect until you enter another SET DEFAULT command or log out. You can also specify the device to which you want to set default without including the directory in the command.

The following example shows how to change the default device:
$ SHOW DEFAULT
  DISK1:[JONES]
$ SET DEFAULT DISK2:[GROUP]
$ SHOW DEFAULT
  DISK2:[GROUP]
In the following example, the directory [JONES] is assumed and exists on DISK1 and DISK2:
$ SHOW DEFAULT
  DISK1:[JONES]
$ SET DEFAULT DISK2:
$ SHOW DEFAULT
  DISK2:[JONES]

4.3.3. Using Temporary Defaults

If you enter a list of files and do not give a complete file specification for each file in the list, the system applies temporary defaults for node names, device names, and directory names. To substitute your current default directory for a temporary default, use empty square brackets. If you include a node name in a file that appears in a list, you can override the temporary default by using a double colon.

In the following example, A.LIS and B.LIS are copied from the [STATS] directory to the [RESULTS] directory:
$ COPY [STATS]A.LIS,B.LIS  [RESULTS]

Note that the system uses the preceding file specification in the list, [STATS]A.LIS, to determine that the temporary default directory for file B.LIS is [STATS] as well.

In the following example, a temporary default device and two different directories are used:
$ COPY BASE:[STATS]A.LIS,[TIME]B.LIS,C.LIS  [RESULTS]

All three files (A.LIS, B.LIS, and C.LIS) are copied from the BASE device. The A.LIS file is copied from the [STATS] directory. The other two files are copied from the [TIME] directory.

In the following example, the current default directory is [BETA]. This command copies [ALPHA]TEST.DAT and [BETA]FINAL.DAT to the [RESULTS] directory:
$ COPY [ALPHA]TEST.DAT,[]FINAL.DAT  [RESULTS]

4.4. Protecting Directories from Other Users

You cannot completely protect a file without applying at least the same protection to the directory in which the file resides. For example, if you deny a user all access to a file but allow that user read access to the file's directory, the user cannot access the contents of the file but can see that it exists. Conversely, a user allowed access to a file and denied access to the file's directory (or one of the parent directories) cannot see that the file exists.

Note

To protect private files, directory protection alone is not adequate. You must also protect each file within the directory.

By default, top-level directories receive UIC-based protection (S:RWE,O:RWE,G:RE,W:E) and no ACL. Subdirectories receive UIC-based protection from the parent directory. For more information on protection codes, see Section 10.3, “Interpreting Protection Codes”.

To specify UIC-based protection explicitly when creating a directory, use the /PROTECTION qualifier with the CREATE/DIRECTORY command. You cannot specify an ACL for the directory until the directory is created. To change the UIC-based protection of an existing directory, apply the SET SECURITY/PROTECTION command to the directory file.

You can limit but not prohibit directory access by specifying execute access but not read access. Execute access on a directory permits you to examine and read files that you know are contained in the directory; that means you can examine a file if you already know what the file specification is, but you cannot display a list of the files in the directory. For additional security information, refer to the VSI OpenVMS Guide to System Security.

4.5. Using Wildcards to Search the Directory Structure

From any point in a directory structure, you can refer to another directory or subdirectory in the structure. Do this by specifically naming the directory or subdirectory you want or by using the ellipsis (…) and hyphen (-) wildcard characters. For additional information about wildcards, see Section 3.2, “Using Wildcards with File Names”.

If you are working in an environment with extended file specifications, refer to Chapter 5, Extended File Specifications for further information about searching directory structures with wildcards.

4.5.1. Ellipsis Wildcard Character

Use the ellipsis (…) wildcard character to search down into the directory hierarchy. To search the current directory and all the subdirectories below it, use the ellipsis by itself as shown:
$ DIRECTORY [...]

If you begin the directory specification with an ellipsis, the search begins from your current directory. However, if you begin the directory specification with a period, only the subdirectory that is one level lower than the current directory is searched.

To search all top-level directories and their subdirectories from wherever you are in the directory structure, use an asterisk (*) followed by an ellipsis (…).

In the following example, assuming the current directory is [JONES], the latest versions of all files named FEES.DAT in [JONES] and all subdirectories under [JONES] will be displayed:
$ TYPE [JONES...]FEES.DAT
In the following example, assuming the current default directory is [JONES], all subdirectories that end in .SALES are searched, and the latest versions of the file FEDERAL.LIS are displayed:
$ TYPE [...SALES]FEDERAL.LIS
In the following example, the latest versions of all files named DEPT.DAT in [JONES] and all subdirectories under [JONES] are displayed:
$ TYPE [...]DEPT.DAT
In the following example, assuming the current directory is [JONES], the [.LICENSES] subdirectory will be searched for the file MAILING.LIS, but [JONES.LICENSES.MARRIAGE] will not:
$ TYPE [.LICENSES]MAILING.LIS
In the following example, assuming the current directory is [JONES], the latest versions of all files named DEPT.DAT in the [.LICENSES] subdirectory under [JONES] and all subdirectories under the [.LICENSES] subdirectory are displayed:
$ TYPE [...LICENSES...]DEPT.DAT
In the following example, as many as eight levels of directory names (the top-level directory and seven subdirectories) are searched (if they exist). Note that the command shown requires READALL privilege.
$ DIRECTORY [*...]

4.5.2. Hyphen (-) Subdirectory Character

Hyphen characters are used as an abbreviated way to specify [sub-]directories above the current process default directory. Each hyphen represents one level. Hyphens can be followed by subdirectory names (with separating periods) to specify other paths down the directory hierarchy.

If you enter so many hyphens that the reference points above the top-level directory, the system displays an error message.

In the following example, the current process default directory is [JONES.LICENSES]. The following command displays the latest version of STAFF.DIS in [JONES]:
$ TYPE [-]STAFF.DIS
In the following example, the current directory is [JONES.LICENSES]. The command shown displays the latest version of BILLING.DAT in [JONES.TAXES]:
$ TYPE [-.TAXES]BILLING.DAT
In the following example, the command shown changes the process default directory to one that is two levels above the current level in the directory hierarchy.
$ SET DEFAULT [–]
On OpenVMS Version 7.2 Alpha or later with ODS-5 disks, file names and subdirectory names can consist solely of hyphens. To distinguish between a (sub-)directory whose name consists of hyphens and a relative specification, the former must be specified with at least one RMS escape character (^). The following specification refers to the directory three levels above the current process default.
[—]
The following specification refers to the directory (UFD) "—":
[^—]

4.6. Working with Directories in UIC Format

Although this chapter focuses on how to use named directories, you can also specify directory names in UIC format. In UIC format, a 2-part octal number forms a user identification code (UIC) that refers to a user file directory (UFD). Almost every DCL command that accepts a file specification can recognize directory names in UIC format. In general, you do not need to use this format unless you are working with a real-time Resource Sharing Executive (RSX) operating system.

A UIC directory specification has the following format:
[group,member]

For example, [122,1] is a UIC directory specification representing member 1 in group 122. Directory names in UIC format generally, but not necessarily, correspond to the UIC of the owner of the directory.

When you refer to a UIC directory, observe the following rules:
  • Use an octal number in the range of 1 to 37776 to specify the group.

  • Use an octal number in the range of 0 to 177776 to specify the member.

  • Do not use the hyphen (-) or ellipsis (…) wildcard as part of the specification.

4.6.1. Using Wildcards with UIC Directories

It is also possible to use the asterisk (*) wildcard to specify a UIC directory. For example, [*,6] indicates all directories with any group number and a member number of 6. The search is limited to directories in UIC format. The directory specification [*,*] locates all directories in UIC format. To locate all named directories as well as all directories in UIC format, use [*].

4.6.2. Translating to Named from UIC Format

Note that you can translate a directory name in UIC format to named format. If necessary, add zeros to the left of the group and member numbers to create a 6-character name.

You cannot combine UIC format and named format. If you have a directory with a name in UIC format and you want to specify one of its subdirectories, translate the UIC format to named format.

The named equivalent of the UIC directory specification [122,1] is as follows:
[122001]

To refer to the subdirectory [122,1]SUB.DIR, use the named directory [122001.SUB].

Chapter 5. Extended File Specifications

OpenVMS Alpha Version 7.2 implemented Extended File Specifications, which consists of two major components:
  • An optional volume structure, On–Disk Structure Level 5 (ODS-5) that supports longer file names with a greater range of legal characters

  • Deep directories

Taken together, these components provide much greater flexibility for OpenVMS Alpha systems (using Advanced Server for OpenVMS) to store, manage, serve, and access files that have names similar to those in a Windows environment.

Deep directories and extended file names provide the following benefits:
  • OpenVMS users can make use of long file names, new character support, and the ability to have lowercase and mixed-case file names. These new capabilities make file activity on an OpenVMS file server more transparent to Windows users.

  • OpenVMS system managers can see files on OpenVMS systems with the names specified by Windows users.

  • Applications developers who are porting applications from other environments that have support for deep directories can use a parallel structure on OpenVMS.

5.1. ODS-5 Volume Structure

On–Disk Structure (ODS) refers to a logical stucture given to information stored on a disk. ODS-2 is the default disk structure of the OpenVMS operating system. ODS-5 is a superset of ODS-2 that is especially useful in multiplatform environments. The ODS-5 volume structure provides:
  • Long file names

  • More characters legal within file names

  • Preservation of case within file names

5.1.1. Long File Names

Traditional (ODS-2) file specifications follow the 39.39 format, supporting only a single period (.) separating the file name and file type.

On an ODS-5 volume, the file name together with the file type can be up to 236 8-bit characters, or 118 16-bit characters, in length?. For example:
$ CREATE This.File.Name.Has.A.Lot.Of.Periods.DAT
$ CREATE -
_$ ThisIsAVeryLongFileName^&ItWillKeepGoingForLotsAndLotsOfCharacters.Exceed -
_$ ingThe39^,39presentInPreviousVersionsOfOpenVMS
$ DIRECTORY


Directory TEST$ODS5:[TESTING]

ThisIsAVeryLongFileName^&ItWillKeepGoingForLotsAndLotsOfCharacters.Exceeding
The39^,39presentInPreviousVersionsOfOpenVMS;1
This^.File^.Name^.Has^.A^.Lot^.Of^.Periods.DAT;1

Total of 2 files.

5.1.2. More Characters Legal Within File Names

Traditional (ODS-2-compliant) file names can use alphanumeric characters (A-Z, a-z, 0-9), the dollar sign ($), underscore (_), and hyphen (-). ODS-5 offers a broader set of characters for naming files.

ISO LATIN-1 and Unicode (UCS-2) Character Sets

ODS-5 supports file names that use the 8-bit ISO Latin-1 character and 16-bit Unicode (UCS-2) character sets. The ISO Latin-1 Multinational character set is a superset of the traditional ASCII character set. In extended file specifications, you can use all characters from the 8-bit ISO Latin-1 Multinational character set except the asterisk (*) and the question mark (?).

Special Characters

Some ISO Latin-1 characters require an escape character to precede them in a file specification in order to be interpreted correctly. In extended file names, RMS and DCL interpret the circumflex (^) as an escape character. The following list contains rules for using the escape character:
  • The escape character (^) followed by an underscore (_) or a space represents a space.

  • The escape character (^) followed by any of the following characters means that the character is to be used as part of a file name, rather than having any special meaning that it might otherwise have in a file specification:
    .  ,  ;  [  ]  %  ^  &
  • You can enter a literal period (.) with or without the escape character (^) in a file name. The system adds the escape character to any periods other than those that act as delimiters for the file type and version number. Literal periods (.) in directory names must be preceded by the escape character.

  • An escape character followed by a hexadecimal digit requires a second hexadecimal digit. Interpret the two following characters as a hexadecimal value for an arbitrary 1-byte character. For example, ^20 represents a space.

  • An escape character followed by U within a file specification indicates that the four hexadecimal digits that follow are to be interpreted as Unicode. For example, ^U012F.

    All characters in file specifications that are not preceded by an escape character (^) are presumed to be ISO Latin-1.


Note

File names containing special characters cannot be accessed from a VAX system. See Section 5.7, “Working in Mixed Environments” for more information about mixed-architecture environments.

Interpretation of Period (.)

The use of the period (.) as a literal character in extended file names requires RMS to determine which periods are file name characters and which are delimiters.

When only one period (.) is used in an extended file name, that period is interpreted as the delimiter. As in previous versions of OpenVMS, this behavior also occurs if the single period is followed by a number:
$ CREATE Test.1
creates the file:
Test.1;1

Determination of Version Numbers

When there are multiple periods (.) in a file name, RMS looks at all the characters after the last period.

If

Then

The characters after the last period are all numeric

The numeric string is determined to be a version number

The characters after the last period are all numeric and preceded by a minus sign (-)

The numeric string is determined to be a version number

There are more than 5 numeric characters after the last period

RMS rejects the file name as illegal

There is a nonnumeric character following the last period

It is interpreted as a file type delimiter

For example, the following command:
$ CREATE Test4.3.2.1
creates the file:
Test4^.3.2;1

where 2 is the file type and 1 is the file version.

A version number explicitly delimited by a semicolon (;) must also be 5 or fewer numeric characters, and can be preceded by a minus sign (-).

5.1.3. Preservation of Case

In prior versions of OpenVMS, DCL, and RMS converted all file specifications to uppercase.

On ODS-5 volumes, you can enter file names in uppercase, lowercase, or mixed case. The case of all files names is preserved as created. For example:
$ CREATE KitContents.Txt

$ DIRECTORY

Directory  DISK1:[USER1]

KitContents.Txt;1
When you create multiple files with the same name differing only in case, DCL treats the subsequent files as new versions of the original file, and converts them to the same case as the original file. For example:
$ CREATE CaPri
$ CREATE CAPRI
$ CREATE capri
$ DIRECTORY

Directory  DISK1:[USER1]

CaPri.;1        CaPri.;2        CaPri.;3

5.1.4. Using Wildcards

Single- and multiple-character wildcards function as expected with ODS-5 files. A single-character wildcard represents exactly one character in either the file name or file type, but may not be used in the file version string. A multiple-character wildcard can represent any number of characters (including zero characters) in the file name or file type. A multiple-character wildcard can be used in place of a version string.

5.1.4.1. Wildcard Characters

The following characters are always valid wildcard characters:
  • The asterisk (*) is a multiple-character wildcard.

  • The percent sign (%) is a single-character wildcard.

  • The question mark (?) is a single-character wildcard.

The percent sign (%) continues to be a single-character wildcard to maintain compatibility with existing applications. The percent sign (%) may be used as a literal character when preceded by the circumflex (^) and is also a literal character in Windows file names. In addition to the percent sign, RMS also recognizes the question mark (?) as a single character wildcard. The question mark functions identically to the percent sign as a wildcard character on OpenVMS 7.2 and later. The percent sign and the question mark each matches exactly one character in a search pattern.

Note

An escaped character (such as ^.) or an escape sequence (such as ^EF or ^U0101) is considered a single character for purposes of wildcard matching.

5.1.4.2. Wildcard Syntax

Although DCL preserves the case of extended file names, wildcard matching is case blind.

A search operation with wildcards continues to match only against the corresponding character in the same part of the target file. Table 5.1, “Sample Wildcards and Matching Patterns” contains examples of some wildcard searches.
Table 5.1. Sample Wildcards and Matching Patterns

The pattern...

matches...

...but does not match

A*B;*

AHAB.;1

A.B;1

A.*.B*

A^.DISK.BLOCK;1

A^.C^.B.DAT;1

A?B.TXT;*

A^.B.TXT;5

A^.^.B.TXT;1

*.DAT

Lots^.of^.Periods.dat;1

DAT.;1

Mil?no.dat

Milano.dat;1

Millaano.dat;1

NAPOLI.?.DAT

napoli.q.dat;1

napoli.abc77.dat;1

5.2. Deep Directory Structures

Both ODS-2 and ODS-5 volume structures support deep nesting of directories on OpenVMS Alpha, as follows:
  • There can be up to 255 levels of directories.

  • On ODS-2 the format for a directory name is 39.39.

  • On ODS-5 the name of each directory can be up to 236 8-bit or 118 16-bit characters long.

For example, you can create the following deeply nested directory:
$ CREATE/DIRECTORY [.a.b.c.d.e.f.g.h.i.j.k.l.m]
You can create the following directory with a long name on an ODS-5 volume:
$ CREATE/DIRECTORY
[.AVeryLongDirectoryNameWhichHasNothingToDoWithAnythingInParticular]

Complete file specifications longer than 255 bytes are abbreviated by RMS when presented to unmodified applications.

5.2.1. Directory Naming Syntax

On an ODS-5 volume, directory names conform to most of the same conventions as file names when using the ISO Latin-1 character set. Periods and special characters can be present in the directory name, but in some cases, they must be preceded by a circumflex (^) in order to be recognized as literal characters, as shown in Table 5.2, “Directory Names on ODS-5 Volumes”.
Table 5.2. Directory Names on ODS-5 Volumes

CREATE/DIRECTORY. . .

Result

[Hi^&Bye]

Hi^&Bye.DIR;1

[Lots^.Of^.Periods^.In^.This^.Name]

Lots^.Of^.Periods^.In^.This^.Name.DIR;1

5.2.2. Directory ID and File ID Abbreviation

Under some circumstances, a full file specification may contain more characters than the 255 bytes allowed by unmodified applications. If a file specification that such an application needs exceeds 255 bytes in length, RMS generates a shorter file specification by abbreviating the directory to a Directory ID (DID), and if necessary, the filename to a File ID (FID).

When the file specification is too long, RMS first attempts to generate a shorter directory specification by identifying the directory with its directory ID. This shorter specification is referred to as a DID.
TEST$ODS5:[5953,9,0]Alghero.TXT;1

Note that this form of the directory name must have three numbers and two commas to avoid ambiguity with UIC format directory names. With the DIRECTORY command you can view the shorter DID version as well as the full version of a file specification.

5.3. Using the Extended File Specifications Parsing Feature in DCL

The default DCL parsing style for file names is for ODS-2 style file names.

When using extended file names on the DCL command line, you need to set the parsing style to EXTENDED to accept and display extended file specifications. To set the parsing style, enter the command:
$ SET PROCESS/PARSE_STYLE=EXTENDED

Note that this command has no effect on an OpenVMS VAX system.

After you enter the command, DCL accepts a file name such as the following:
$ CREATE MY^[FILE

For additional information, see the description of the SET PROCESS/PARSE_STYLE command in the VSI OpenVMS DCL Dictionary: N–Z.

To reset DCL to the default parsing style, enter the following command:
$ SET PROCESS/PARSE_STYLE=TRADITIONAL

After you enter this command, DCL accepts only ODS-2 file name formats.

5.4. Where You Can Use Extended File Specifications

Some DCL commands and OpenVMS utilities fully support extended file specifications. They have been modified to take advantage of all the features of extended file names. They can accept and handle extended file specifications without error and without modifying their expected case. In addition, they can accept and produce long file specifications that exceed the traditional 255-byte limit in their original form?–without requiring them to be abbreviated in Directory ID (DID) or File ID (FID) format.

DCL commands and OpenVMS utilities with default support have had little or no modification to take advantage of extended file names. These utilities and commands are expected to handle most of the attributes of extended file specifications (such as new characters and deep directory structures) correctly. However, they might create or display file names with the wrong case.

In contrast with utilities that have full support, utilities with default support rely on DID and FID abbreviation offered by RMS to handle long file specifications. As a result, these utilities are subject to the following restrictions related to DID and FID abbreviation:
  • Matching operations in an environment where FID abbreviation is used may not always work as expected. For example, wildcard matching operations may not capture all target file names because the long file names may be represented in their numeric FID-abbreviated form. This restriction specifically applies to matching operations that are performed outside of RMS.

  • Wildcards and sticky defaults cannot be used with a FID abbreviation. For example, the following commands are illegal:
    $ DIRECTORY a[1,2,3]*.txt
    $ COPY a[1,2,3].txt *.txt2

    Because a FID abbreviation is a unique numeric representation of one file, it cannot be used to represent or match any other file.

  • Creating a file using a FID abbreviation is illegal.

For more information about DID and FID abbreviations, refer to the VSI OpenVMS Guide to OpenVMS File Applications.

For more information on a specific command or utility, refer to the appropriate manual in the OpenVMS documentation set.

No Support for Extended File Naming

OpenVMS utilities and commands that do not support extended file names can function on ODS-5 volumes; however, they are restricted to operating with traditional file specifications only. These utilities and commands should be used carefully on ODS-5 volumes because VSI cannot ensure that they will function successfully when they encounter extended file specifications.

No Support for ODS-5

OpenVMS utilities and commands that do not support the ODS-5 volume structure cannot handle extended file names. These utilities and commands should be used carefully on ODS-5 volumes because VSI cannot ensure that they will function successfully even when they only encounter traditional file specifications.

Table 5.3, “Non-Supported OpenVMS Components” lists the OpenVMS utilities and commands that do not support Extended File Specifications because of limitations with either extended file names or ODS-5.
Table 5.3. Non-Supported OpenVMS Components

Component

Notes

No ODS-5 Support

Disk defragmenters

Unsupported unless a specific defragmentation tool documents that it has been updated to support an ODS-5 volume.?

No Extended File Naming Support

Code compilers

Cannot use extended file names for object files. However, code compilers can create applications that support extended names.

INSTALL Known images

Do not install an image with an extended file name as a known image.

LINK

Cannot output an image with an extended file name.

MONITOR

Cannot reliably process extended file names.

Network files (NET*.DAT)

Do not rename to an extended file name.

Object modules (.OBJ)

Do not rename to an extended file name.

Page and swap files

Do not use an extended file name.

SYSGEN

Do not write a parameter file with an extended file name.

System startup files

Do not rename to an extended file name.

5.5. Displaying Files with Extended Names

Some DCL commands have the following new qualifier to control the display of extended file names:
/STYLE= [CONDENSED | EXPANDED]

This qualifier allows you to control how the modified DCL commands display extended file names and any associated prompts.

The keyword CONDENSED displays the file specification as it is generated to fit within the 255-byte character string limit imposed by many utilities. When necessary, this file specification may contain a DID abbreviation or a FID abbreviation. The keyword EXPANDED displays the file specification that is stored on disk in full and does not contain a DID abbreviation or a FID abbreviation.

The following sections contain examples of using the /STYLE qualifier with the DIRECTORY, TYPE, PURGE, and DELETE commands.

5.5.1. DIRECTORY Command

The DIRECTORY command allows you to select in what format the file name is displayed when viewing the contents of a directory:
DIRECTORY/STYLE=(keyword[,keyword])
The DIRECTORY command by default displays file names as you see in the following example, using DIDs where necessary and switching back to the full directory specification where DIDs are not necessary:
$ DIRECTORY

Directory TEST$ODS5:[23,1,0]

abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrs
tuvwxyABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyABCDEFGHIJKLM
NOPQRSTUVWXY.abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYabcdef
ghijklmnopqrst;2

Total of 1 file.

Directory TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]

AddressFiles.DIR;1  LOGIN.COM;3         test.1;1       test^.1.clue;1
Travel.LIS;1        whee.;5             work.dat;8

Total of 8 files.

Grand total of 2 directories, 9 files.
The DIRECTORY command, using both keywords with the /STYLE qualifier, produces a two-column directory list. Each column lists all the file names. The CONDENSED column contains any needed DIDs or FIDs, while the EXPANDED column contains full directory names and file names. Any file errors are displayed in the CONDENSED column. The following example shows the results of the DIRECTORY command with the /STYLE qualifier taking both keywords:
$ DIRECTORY/STYLE=(CONDENSED,EXPANDED)

Directory TEST$ODS5:[23,1,0]        TEST$ODS5:[TEST.RANDOMTESTING.RANDO
                                    M]

abcdefghijklmnopqrstuvwxyABCDEFGHIJ abcdefghijklmnopqrstuvwxyABCDEFGHIJ
KLMNOPQRSTUVWXYabcdefghijklmnopqrst KLMNOPQRSTUVWXYabcdefghijklmnopqrst
uvwxyABCDEFGHIJKLMNOPQRSTUVWXYabcde uvwxyABCDEFGHIJKLMNOPQRSTUVWXYabcde
fghijklmnopqrstuvwxyABCDEFGHIJKLMNO fghijklmnopqrstuvwxyABCDEFGHIJKLMNO
PQRSTUVWXY.abcdefghijklmnopqrstuvwx PQRSTUVWXY.abcdefghijklmnopqrstuvwx
yABCDEFGHIJKLMNOPQRSTUVWXYabcdefghi yABCDEFGHIJKLMNOPQRSTUVWXYabcdefghi
jklmnopqrst;2                       jklmnopqrst;2
AddressFiles.DIR;1                  AddressFiles.DIR;1
LOGIN.COM;3                         LOGIN.COM;3
test.1;1                            test.1;1
test^.1.clue;1                      test^.1.clue;1
Travel.LIS;1                        Travel.LIS;1
whee.;5                             whee.;5
work.dat;8                          work.dat;8

Total of 8 files.

DIRECTORY can either use one or both keywords with the /STYLE qualifier.

5.5.2. TYPE Command

The TYPE command accepts the /STYLE qualifier to select the file name format displayed in system messages while typing files and prompts:
$ TYPE/STYLE=(keyword)
This example shows the use of the TYPE command with the TYPE=EXPANDED and CONFIRM qualifiers:
$ TYPE/CONFIRM/STYLE=EXPANDED abc*.*rst;2
TYPE TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]abcdefghijklmnopqrstuvwxyzABCDEF
GHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYabc
defghijklmnopqrstuvwxyzGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrst;2 ? [N]: Y

[System outputs contents of file]

5.5.3. DELETE Command

The DELETE command accepts the /STYLE qualifier to select the file name format for display purposes when performing the command:
$DELETE/STYLE=(keyword)

In the following examples, the ellipsis (...) represents many characters within the file name. These examples use the CONFIRM qualifier to generate a system message.

DELETE using default (CONDENSED):
$ DELETE/CONFIRM abc*.*.*
DELETE TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]abcAlphabet.stuff;1 ? [N]: Y
DELETE TEST$ODS5:[23,1,0] abcdefg. . .QRSTUVWXY.abcdefg. . .tuvw
xy;1 ? [N]: Y
When the full file specification is required, use the DELETE command with the /STYLE qualifier and the EXPANDED keyword:
$ DELETE/CONFIRM/STYLE=EXPANDED abc*.*.*
DELETE TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]abcAlphabet.stuff;1 ? [N]: Y
DELETE TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]abcdefg. . .QRSTUVWX
Y.abcdefg. . .tuvwxy;1 ? [N]: Y

5.5.4. PURGE Command

The PURGE command accepts the /STYLE qualifier to select the file name format for display purposes when performing the command:
$ PURGE/STYLE=(keyword)

In the following examples, the ellipsis (...) represents many characters within the file name. These examples use the CONFIRM qualifier to generate a system message.

PURGE using default (CONDENSED):
$ PURGE/CONFIRM
DELETE TEST$ODS5:[23,1,0]abcdefg. . .QRSTUVWXY.abcdefg. . .tuvwxy;1
? [N]: Y
When the full file specification is needed, use the PURGE command with the /STYLE qualifier and the EXPANDED keyword:
$ PURGE/CONFIRM/STYLE=EXPANDED
DELETE TEST$ODS5:[TEST.RANDOMTESTING.RANDOM]abcdefg. . .QRSTUVWXY.ab
cdefg. . .tuvwxy;1 ? [N]: Y

5.6. Displaying Extended File Names on a Terminal

To display extended file names, your terminal must be set to display the ISO Latin-1 character set. Otherwise, the characters displayed on the terminal might not match those shown by a PC. To view or change the character set displayed on your terminal, use the terminal setup dialog box. The options for selecting the character set to display are usually found in the General tab.

The characters that differ between the DEC Multinational and ISO Latin-1 character sets are listed in Appendix A, Character Sets.

5.7. Working in Mixed Environments

If your system is running OpenVMS Alpha Version 7.2 or higher, you can take advantage of all extended file specifications capabilities on ODS-5 volumes. You also can continue to access pre-Version 7.2 files and directories. For example, you can do all of the following:
  • Create and access deep directory structures on ODS-2 volumes

  • Read a BACKUP saveset created on an earlier version of OpenVMS

  • Copy a file with an ODS-5 name to a file with an ODS-2 name on a system running an earlier version of OpenVMS

If you are working in a mixed-version or mixed-architecture OpenVMS Cluster, there are some limitations. Systems running prior versions of OpenVMS cannot mount ODS-5 volumes, correctly handle extended file names, or even see extended file names. Users on a version of OpenVMS prior to Version 7.2 cannot access any files on an ODS-5 volume. This is true regardless of whether the volume is connected physically on a CI or SCSI bus, or by an MSCP or QIO server. Nor can these users create or restore an ODS-5 image saveset. However, they can restore ODS-2-compliant file names from an ODS-5 saveset.

OpenVMS Version 7.2 VAX systems are limited to the following extended file specifications functionality:
  • Ability to mount an ODS-5 volume.

  • Ability to write and manage ODS-2-compliant files on an ODS-5 volume.

  • See pseudonames (pISO_LATIN.??? or pUNICODE.???) when accessing an ODS-5 file specification.

When working in an environment that contains both OpenVMS Alpha and OpenVMS VAX systems, it is important to know the following:
  • Your system type and operating system version

  • Whether your default directory is ODS-2 or ODS-5 based

  • Whether the destination for a file you are creating is an ODS-2 or ODS-5 volume

OpenVMS 7.2 allows VAX systems to mount ODS-5 volumes; however, users on OpenVMS VAX systems can access only files with ODS-2-compliant file names.

You can choose whether or not to convert a volume to ODS-5 on your OpenVMS Alpha systems. When working in a mixed environment of ODS-2 and ODS-5 volumes, keep in mind the restrictions of ODS-2 file names when creating files on ODS-5 volumes. If you copy a file that has special characters in its name from an ODS-5 to an ODS-2 volume, you must give it an ODS-2 compliant name.

Chapter 6. Using Disk and Tape Drives

This chapter describes general concepts about working with disk and tape drives on an OpenVMS system. Any peripheral connected to an OpenVMS system, including disk and tape drives, is referred to as a device. When you log in you are automatically granted access to your default login device and directory. You can also access public devices and directories. In most cases, the system manager sets up and maintains devices that are shared by a group of users.

If there is a drive available for your personal use, you need to know how to allocate, initialize, and mount it. This chapter discusses the following concepts for those who will be implementing their own disk and tape drive access:
  • Physical device names

  • Displaying device information

  • Logical device names

  • Generic device names

  • OpenVMS Cluster device names

  • Volumes and volume sets

  • Device management

For additional information, refer to:
  • The VSI OpenVMS DCL Dictionary or online help, for information about the commands discussed in this chapter

  • The VSI OpenVMS System Manager's Manual, Volume 1: Essentials, for information on using devices

  • The VSI OpenVMS System Management Utilities Reference Manual, for information about the MOUNT command

  • The VSI OpenVMS Cluster Systems Manual, for information about devices in OpenVMS Cluster environments

6.1. Physical Device Names

Each physical device known to the system is uniquely identified by a physical device name. The physical device name identifies the type of device; for example, a disk drive or a terminal.

Most physical device names consist of:
  • A device code, which represents the hardware type

  • A controller designator, which identifies the hardware controller to which the device is attached

  • A unit number, which identifies a device on a particular controller.

VTA12, FX09, and DAD44 are examples of disk and tape device names.

For information on specific device-naming formats, refer to the VSI OpenVMS System Manager's Manual.

6.2. Displaying Device Information

To display information about disk and tape devices that are on the system, enter the SHOW DEVICES command. To obtain additional information or information about a specific device, enter the SHOW DEVICES command in one of the following ways:
  • To check the densities, volume labels, UICs, and relative volume numbers of mounted volumes, enter the SHOW DEVICES/FULL command.

  • To display information for all the drives of a particular type configured in the system, specify a generic device code (for example, SHOW DEVICES DK).

  • To display information for a volume mounted on a specific drive, specify the physical device name (for example, SHOW DEVICES DKA1).

In the following example, the SHOW DEVICES command displays information about DAD40:
$ SHOW DEVICES DAD40

Device         Device           Error    Volume         Free  Trans Mnt
 Name          Status           Count     Label        Blocks Count Cnt
DAD40:         Mounted wrtlck       0     CHICAGO      540088     1   1

6.3. Logical Device Names

Your system manager can set up logical device names to represent the devices on the system. Logical device names equate a somewhat cryptic device name to a short, meaningful name. You can use these logical device names, rather than the physical device names, to refer to devices.

Chapter 11, Defining Logical Names for Devices and Files describes in detail how to use logical names.

6.4. Generic Device Names

A generic device name consists of the device code and omits the specific controller or unit number. When you use a generic device name with a MOUNT or ALLOCATE command, the system locates the first available controller or device unit whose physical name satisfies the portions of the generic device name you specified.

If you specify a generic device name for any other command, the following defaults apply:
  • If you omit the controller designation, it is assumed to be A.

  • If you omit the unit number, it is assumed to be 0.

6.5. OpenVMS Cluster Device Names

An OpenVMS Cluster device name includes the name of the node to which the device is attached and the physical device name, separated by a dollar sign ($). For example, ROXXY$DUA1 refers to disk DUA1 on node ROXXY.

As a general rule, always use a node allocation class device name to identify dual-pathed OpenVMS Cluster disks. It is the only name that all OpenVMS Cluster nodes recognize at all times.

For more information about using the device name format in OpenVMS Cluster environments, refer to VSI OpenVMS Cluster Systems Manual.

If a device is dual pathed (connected to two nodes), specify the OpenVMS Cluster device name in the following format:
$node-allocation-class$ddcu
The elements are:

node-allocation-class

A value assigned to the nodes connecting a dual-pathed device. For example, $1$DJA16 identifies a disk that is dual pathed between two nodes that both have a node allocation class value of 1.

dd

Represents device code of the hardware device type (for example, the device code DK represents an RZ23 disk).

c

Identifies the hardware controller to which the device is attached. The controller designation, along with the unit number, identifies the location of the device within the hardware configuration of the system. Controllers are designated with alphabetic letters A to Z.

u

Uniquely identifies the unit number of a device on a particular controller. Unit numbers are decimal numbers from 0 to 65535.

6.6. Volumes and Volume Sets

The OpenVMS operating system recognizes disks and tapes, separate from the actual hardware drives they occupy, as volumes. A volume is an organized collection of data. The system also recognizes volume sets. A volume set consists of two or more related volumes. Binding volumes into a volume set allows you to extend the space available for your files by adding volumes to the same set, rather than by defining multiple, new volumes. The procedures for creating volume sets (as opposed to single volumes) are described in the VSI OpenVMS System Manager's Manual.

6.7. Device Management

If you have a disk drive available for your private use, you should be familiar with the steps for setting it up, as follows:

Step

Task

1

Use the DCL command ALLOCATE to assign the disk drive to your process.

2

Use the DCL command INITIALIZE to format the disk volume and write an identifying label on the volume, if needed.

3

Use the DCL command MOUNT to make a volume and the files or data it contains accessible to your process.

6.7.1. Allocating Devices

When you allocate a device, you reserve the device for exclusive use by your process. The device remains allocated to your process until you explicitly deallocate it (with the DCL command DEALLOCATE) or until you log out.

To allocate (locally assign) a disk or tape drive to your process, use the DCL command ALLOCATE. The format for the ALLOCATE command is as follows:
ALLOCATE device-name[:][,...] [logical-name[:]]
The elements are as follows:

device-name

Specifies the drive on which the volume is loaded. The name can be a physical name, a generic name, or a logical name.

logical-name

Specifies an optional logical name to be associated with the device.

6.7.2. Initializing Volumes

Initializing a disk or magnetic tape volume formats it. You do not need to do this prior to every use of a volume. Initialize a volume before its first use and anytime you want to erase it entirely. To initialize a volume, use the DCL command INITIALIZE, which does the following:
  • Creates a new file structure on the volume. Any data stored on the disk at the time of initialization is deleted during the initialization process.

  • Writes a label on the volume to identify it.

  • Defines the owner UIC and the protection for the volume.


Note

The INITIALIZE command does not prevent you from initializing another user's volume; to be sure the volume you initialize is your own, allocate the device before you initialize the volume.

If you give a volume to another user for initialization (for example, if you lack sufficient privileges to do it yourself), you should provide the volume label, the owner UIC, and the protection code for the volume.

The format for the INITIALIZE command is as follows:
INITIALIZE device-name[:] volume-label
The fields are as follows:

device-name

Specifies the name of the device on which the volume is physically mounted.

volume-label

Identifies the volume. You can specify up to 12 alphanumeric characters for a disk volume or up to 6 alphanumeric characters for a magnetic tape volume.

Initializing Disk Volumes

By default, the INITIALIZE command builds a Files–11 structure on your new volume. The default format for disk volumes initialized for or by the OpenVMS operating system is called the Files–11 On-Disk Structure Level 2. The INITIALIZE command can also initialize disk volumes in Files–11 On-Disk Structure Level 1 or 5.

You do not need special privileges to override logical protection on a blank disk volume (that is, a volume that has never been written to) or on a disk volume that is owned by your current UIC or by UIC [0,0]. In all other cases, you must have user privilege VOLPRO to initialize a disk volume.

The following example initializes a volume on DKA300 with the default Files-11 On-Disk Structure Level 2 and labels the volume ACCOUNTS:
$ INITIALIZE DKA300: ACCOUNTS
The following example initializes a volume on DKA300 with the default Files-11 On-Disk Structure Level 5 and labels the volume FILES:
$ INITIALIZE/STRUCTURE=5 DKA300: FILES

6.7.3. Mounting Volumes

After allocating a disk volume, you need to mount it in order to use its files. The DCL command MOUNT makes a volume and the files it contains accessible to your process.

When you enter the MOUNT command, the system verifies that the following conditions have been met:
  • The device has not been allocated by another user.

  • The device protection allows you to allocate the device.

  • A volume is physically loaded on the specified device.

  • The label on the volume matches the label you specified.

You can mount a single volume or a volume set. The procedures for creating and mounting volume sets (as opposed to single volumes) are described in the VSI OpenVMS System Manager's Manual.

The MOUNT command format is as follows:
MOUNT device-name[:][,...] [volume-label[,...]] [logical-name[:]]
The elements are as follows:

device-name

Specifies the physical device name or logical name of the device on which the volume is to be mounted.

volume-label

Specifies the label with which the volume was initialized. You do not need to specify the volume label if you use one of the following MOUNT qualifiers: /FOREIGN, /NOLABEL, or /OVERRIDE=IDENTIFICATION.

logical-name

Defines a name to be associated with the device. If you omit the logical name, the MOUNT command assigns the default logical names DISK$volume-label and TAPE$volume-label to disk and tape drives, respectively.

6.7.4. Requesting Operator Assistance

Operators can perform the physical mounting (and dismounting) of both system and private volumes. If a volume is already placed in the drive you are going to use, you do not need operator assistance.

MOUNT messages are sent to all operators enabled to receive TAPE and DISK messages. For example, if operator assistance is needed for mounting a disk device, a message is sent to disk operators. If no operator is available (operator is not enabled) to receive and respond to a MOUNT request, a message is displayed to inform you of the situation. You can also specify the /NOASSIST qualifier to avoid operator assistance.

The MOUNT command shown here notifies the operator of your mount request and displays a message at your terminal:
$ MOUNT DKA300: DISK VOL1
%MOUNT-I-OPRQST, PLEASE MOUNT DEVICE _MARS$DKA300:
After the device has been successfully mounted, you are notified with the following message:
%MOUNT-I-MOUNTED, DISK mounted on _DKA300:
The following example shows how to allocate, initialize, and mount a disk volume:
$ ALLOCATE DKA300:  TEMP
%DCL-I-ALLOC, _MARS$DKA300: allocated
$ INITIALIZE  TEMP:  BACKUP_FILE
$ MOUNT  TEMP:  BACKUP_FILE
%MOUNT-I-MOUNTED, BACKUP_FILE mounted on _DKA300:
$ CREATE/DIRECTORY  TEMP:[ARCHIE]

Before you can place any files on the volume, you must create a directory, as shown by the CREATE/DIRECTORY command.

Mounting a Foreign Disk Volume

To mount a foreign disk volume (that is, one having a file structure other than Files–11), use the /FOREIGN qualifier. For example:
$ MOUNT/FOREIGN DISK
%MOUNT-I-MOUNTED, BACKUP_FILE      mounted on DISK$DMA2:

The MOUNT/FOREIGN command makes the contents of your volume available to the system but makes no assumptions concerning its file structure. In the preceding example, MOUNT reports a volume label, indicating that the disk has a Files–11 structure, even though it was mounted as a foreign device. If a disk does not have a recognized file structure, MOUNT does not display a label.

Note that you need the user privilege VOLPRO to mount a Files–11 structured disk with the /FOREIGN qualifier, unless its owner UIC matches your own.

6.8. Accessing Files on Private Devices

To access a file that is on a private device, you must either specify the device name or use the SET DEFAULT command to set default to the device and the directory name.

You can use physical, logical, or generic names to refer to devices. In addition, if your system is part of an OpenVMS Cluster system, certain devices are accessible to all members of an OpenVMS Cluster system. To access a file on a tape volume set, specify any device that has been allocated to it.

Although you can print a file from a privately owned volume, the volume containing the file to be printed must remain mounted until after the file has completed printing.

Some commands accept output file specifications. You can replace an output file specification with the name of a record-oriented device such as a printer or a terminal. For example:
$ COPY DFILE.DAT TTB4:

The COPY command sends the file DFILE.DAT to the terminal named TTB4. The terminal accepts and displays the file one record at a time. When you use a device name as a file specification, follow the device name with a colon (:).

6.8.1. Dismounting Volumes

When you are done with the files on a disk or tape volume, you can use the DISMOUNT command to dismount the volume. Before a volume is dismounted, the DISMOUNT command checks for conditions that could prevent the dismount from completing. For example, if the volume contains installed swap and page files, installed images, or open user files, DISMOUNT displays an error message indicating that the volume cannot be dismounted.

By default, the DISMOUNT command automatically unloads the volume from the drive. If you plan to mount or initialize a volume again after you dismount it, you can save time and eliminate unnecessary handling of that volume by using the /NOUNLOAD qualifier. For example:
$ DISMOUNT/NOUNLOAD MTA1:

In this example, the magnetic tape volume is logically dismounted and the tape is rewound but the tape remains physically loaded on drive MTA1.

You should always explicitly dismount a volume with the DISMOUNT command before physically unloading the volume. Wait for the drive to unload before you remove the volume. You can verify that the dismount is complete by entering the DCL command SHOW DEVICES.

A volume is dismounted and unloaded automatically if you log out of the job from which you had mounted the volume. If the system fails, however, the volume is not automatically dismounted. If the device you are dismounting was allocated with an ALLOCATE command, it remains allocated after it is dismounted with the DISMOUNT command. If the device was implicitly allocated by the MOUNT command, the DISMOUNT command deallocates it.

Chapter 7. Using Mail to Communicate with Others

The OpenVMS Mail utility (MAIL) lets you send messages to other users on your system or on any other computer that is connected to your system with VSI TCP/IP for OpenVMS or a DECnet network. This chapter describes:
  • Invoking and exiting mail

  • Reading messages

  • Sending messages

  • Sending mail over networks

  • Sending messages to multiple users

  • Manipulating files in mail

  • Other ways to send messages

  • Organizing messages

  • Deleting messages

  • Printing mail messages

  • Protecting mail files

  • Using text editors in Mail

  • Customizing your Mail environment

  • Summary of Mail commands

  • Using the MIME Utility

For additional information, refer to the following:
  • Enter the HELP MAIL command at the DCL prompt or enter the HELP command at the MAIL> prompt, for more information about Mail commands and qualifiers.

  • The VSI OpenVMS System Manager's Manual, for more information about controlling the use of Mail through user accounts.

  • Enter HELP TCPIP_SERVICES at the DCL prompt, for more information about TCP/IP mail commands and qualifiers.

  • The VSI TCP/IP Services for OpenVMS User's Guide, for more information about sending and receiving mail using TCP/IP services.

The following figure shows a sample mail message and its components.

7.1. Invoking and Exiting Mail

The following sections describe how to invoke and exit Mail.

7.1.1. Invoking Mail

To invoke the Mail utility, enter the DCL command MAIL, as follows:
$ MAIL
MAIL>
Once you are in the Mail utility, you perform the following operations by entering the appropriate command at the MAIL> prompt and then pressing the Enter key:
  • Read a mail message

  • Send a mail message

  • Reply to a mail message

  • Forward a mail message

  • Organize mail messages into files and folders

  • Delete a mail message

  • Print a mail message

7.1.2. Exiting from Mail

To exit from Mail, enter the EXIT command at the MAIL> prompt, as follows:
MAIL> EXIT
$

You can also exit from Mail by pressing Ctrl/Z or by using the QUIT command.

7.2. Reading Messages

Mail stores the messages you receive in mail files, which have the default file type .MAI. In this file, by default, Mail provides two folders that store old and new messages. New messages are automatically placed in a folder called NEWMAIL; old messages are placed in a folder called MAIL. After you read a new message, the message automatically moves from the NEWMAIL folder to the MAIL folder, unless you enter the FILE, MOVE, or DELETE command. Mail deletes the NEWMAIL folder after you have read all new mail messages and either select another folder or exit from Mail.

7.2.1. Reading New Mail

When you are logged in to your account and receive a mail message, Mail notifies you. For example, notification of a message sent by user FELLINI is displayed as follows:
New mail on node DOODAH from STONE::FELLINI     (10:02:23)
To read a new message, invoke Mail and press the Enter key at the MAIL> prompt, as follows:
$ MAIL

You have 1 new message.

MAIL>

If you have more than one new message, press Enter at the MAIL> prompt to read the other messages. When you have read all your new messages, Mail issues the message %MAIL-E-NOMOREMSG, no more messages and continues to prompt for commands until you exit Mail.

If you receive a mail message while you are in Mail, enter the READ/NEW command to read the new message.

7.2.2. Reading Old Messages

To reread old mail messages in your default Mail folder, use the following procedure:
Step

Task

1
Enter the SELECT command at the MAIL> prompt. For example:
MAIL> SELECT MAIL

Mail places you in the folder named MAIL.

2

To read the first message in your default MAIL folder, press Enter at the MAIL> prompt or enter the READ command.

Mail displays the first message (1) in your default mail file.

3

To display the next message, press Enter.

If the message is too long to display on one screen, press Enter to display the next part of the message.

To skip the remainder of a message and display the next message, enter the NEXT command.

To read a particular message in your default MAIL folder, use the following procedure:
Step

Task

1

Enter the DIRECTORY command at the MAIL> prompt.

To select a subset of messages from the list, use the DIRECTORY command qualifiers /FROM or /SUBJECT.

2

Enter the number of the message that you want to read at the MAIL> prompt.

Mail displays the message that you selected.

In the following example, the DIRECTORY command is used to display old messages and then the message labeled 2 is selected for reading:
MAIL> DIRECTORY
                                                          MAIL
# From              Date              Subject
1 STONE::FELLINI    11-DEC-1999       Sales presentation on May 11
2 DOODAH::JONES     11-DEC-1999       Status

MAIL> 2

7.2.3. Searching for Messages

If you have many messages, you can locate a particular message by using the SEARCH command to find a string in one or more of the messages. To search for a string, specify that string as a parameter to the SEARCH command.

Each time you specify a new string, the SEARCH command starts the search at message number 1. To continue searching the folder for messages that contain the specified string, use the SEARCH command without specifying a parameter. To search for the same string in a different folder, enter the SELECT or SET FOLDER folder-name command and continue using the SEARCH command without specifying a parameter.

In the following example, messages in the current folder are searched for the first message that contains the string appointment:
MAIL> SEARCH "appointment"

7.3. Sending Messages

To send a mail message to any user on your system, do the following:
Step

Task

1

Enter SEND at the MAIL> prompt.

Mail prompts you for the name of the user to receive the message.

2

Enter the name of the user receiving the message and press Enter.

Mail prompts you for the subject of the message.

3

Enter the subject of the message and press Enter. Entering this information is optional.

Mail prompts you for the text of the message.

4

Enter the text of a message, or just press Enter. Entering this information is optional.

5

Press Ctrl/Z to send the message. If you decide not to send the message, press Ctrl/C, which cancels the send operation without exiting from Mail.

In the following example, a message is sent to a user named THOMPSON:
MAIL> SEND
To: THOMPSON
Subj: Meeting on April 20
Enter your message below. Press CTRL/Z when complete, or CTRL/C to quit:
I have some new ideas about the Hubbub Cola account.
Let me know  when you are available to talk about them.


–Jeff

7.4. Sending Mail Over Networks

The following sections describe how to send mail across the network.

7.4.1. Specifying Your Network Protocol

When you receive a message, Mail interprets the specified address as follows:
  • If the node component of the address contains a period (.), the address is interpreted as an Internet address. Mail uses the SMTP protocol by default unless you have previously set up your system to use a different Internet protocol by defining that alternate protocol with the MAIL$INTERNET_TRANSPORT logical name.

  • If the node component of the address does not contain a period, the address is interpreted as a DECnet address.

However, you can customize your Mail environment to force the system to choose a specific protocol. This option is helpful in cases where a mail address can be interpreted as valid for either the Internet or DECnet protocol.

To specify protocols, you can define the MAIL$INTERNET_MODE logical name as follows:
  • HYBRID (the default)

    If the node component of the address contains a period (.), Mail uses an Internet protocol. If there are no periods, Mail uses the DECnet protocol.

  • DECNET

    Mail always interprets the node component of the address as a DECnet node specification.

  • SMTP

    Mail always interprets the node component of the address as an Internet address specification. The default transport is SMTP unless you use the MAIL$INTERNET_TRANSPORT logical to define an alternate Internet transport.

To modify your Mail environment in any of these ways, VSI recommends that you define the MAIL$INTERNET_MODE and MAIL$INTERNET_TRANSPORT logical names in your LOGIN.COM file. See Chapter 11, Defining Logical Names for Devices and Files for complete information about using and defining logical names.

For example, if your system is set up to use the default (HYBRID), the Mail address smith@pluto is interpreted as a DECnet address because there are no periods in that address. However, if you want Mail to use SMTP instead of DECnet, you can add the following line to your LOGIN.COM file:
$ DEFINE MAIL$INTERNET_MODE SMTP

When you then specify smith@pluto, Mail interprets this address as an Internet address and uses the SMTP protocol (for example, SMTP%"smith@pluto.xyz.dec.com").

7.4.2. Specifying Node Names

If your computer system is part of a network, you can send mail to any other user on the network. If you are sending mail to someone on a different node, enter the user's node name and user name at the To: prompt. If the user name contains special characters or spaces, you must enclose the user name in quotation marks (""). Use the following format:
nodename::username

Mail displays a message if the network connection to the remote node is not available. Wait a while, and then try again to send the message.

For additional information on specifying node names, refer to Section 3.1.6, “Network Node Names”.

In the following example, a message is sent to user HIGGINS on node CHEETA:
MAIL> SEND
To: CHEETA::HIGGINS

7.4.3. Using Internet Mail Addresses

You can also use full Internet mail addresses to send mail to users over a network. These addresses are common, especially if you are sending mail outside your organization.
username@company.com
At the To: prompt, enter the full Internet address of the user you want to send mail to. These addresses are seldom case-sensitive.
MAIL> SEND
To: J_SMITH@COMPANYNAME.COM, Kate.Muir@school.edu

7.4.4. Using Logical Node Names

You can use a logical name to represent a user's name and node; then you can use the logical name to send mail. Note that Mail ignores any access control information in the node name or logical name.

In the following example, HENRY is used in place of CHEETA::HIGGINS. First, the logical name (HENRY) is defined, then it is used in place of the user name and node:
$ DEFINE HENRY CHEETA::HIGGINS
$ MAIL
MAIL> SEND
To: HENRY

7.5. Sending Messages to Multiple Users

The following sections describe how to send mail to more than one user.

7.5.1. Using Individual Names

You can send mail to several users at the same time in one of two ways: using individual user names at the To: prompt or using a distribution list. To send the same message to several users on the same node by using their user names, enter the user names at the To: prompt and separate them with commas or spaces.

In the following example, a message is sent to Thompson, Jones, and Barney:
MAIL> SEND
To:      THOMPSON,JONES,BARNEY
Subj:    Meeting on January 9

7.5.2. Creating Distribution Lists

A distribution list is a file that contains a list of users and their node names. You must use a text editor to create distribution lists. Distribution lists are not created within the Mail utility.

Your open file quota (a limit associated with your account) determines the number of different nodes to which you can send mail (at one time) and the depth to which you can nest distribution lists. If you exceed the quota, Mail displays an error message. Ask your system manager to increase your quota or send mail in batches to fewer nodes at one time.

By default, the system looks for a distribution list file with the file type .DIS. If the file containing your distribution list has a different file type, specify the file name and file type at the To: prompt. If you invoke Mail while in one directory and the file containing the distribution list is in another, enter the distribution list's full directory name at the To: prompt.

To create a distribution list, use the following procedure:

Step

Task

1

Use a text editor to create a distribution list file with the file type .DIS.

2

Type one user name per line in the file.

3

To include the names of other distribution lists in the file (to nest the lists), specify an at sign (@) followed by the name of the distribution list.

4

To include comments in the file, enter an exclamation point (!) before the comment.

The following example shows a distribution list file:
! ALLBUDGET.DIS
!
! Budget Committee Members
@BUDGET         ! listed in BUDGET.DIS.
! Staff
  Thompson
  BRUTUS::JONES
  PORTIA::BARNEY

If the file BUDGET.DIS is not in the same directory as the new distribution list file you are creating (ALLBUDGET.DIS), include the file specification for BUDGET.DIS in the new distribution file. Depending on where you create ALLBUDGET.DIS, you might have to specify the device and directory in which BUDGET.DIS is located. See Chapter 3, Storing Information with Files for more information about file specifications.

7.5.3. Sending Messages to Distribution Lists

To send mail to several users by using a distribution list, use the following procedure:

Step

Task

1

Invoke Mail.

2

Type SEND at the MAIL> prompt and press Enter.

3

Type an at sign (@) and the file name of the distribution list at the To: prompt. Press Enter.

4

Type the subject of the message at the Subj: prompt and press Enter.

5

Enter the text of the message at the text prompt.

In the following example, a message is sent to the distribution list ALLBUDGET.DIS:
MAIL> SEND
To: @ALLBUDGET
Subj: Tomorrow's Meeting
Enter your message below. Press CTRL/Z when complete, or CTRL/C to quit:

The meeting about the Hubbub Cola account is tomorrow at 2:00.

–Jeff

You can also send a file to a distribution list from DCL level. If you omit the file type .DIS, place quotation marks ("") around the at sign (@) and file name to identify the file as a distribution list. To include a subject, use the /SUBJECT qualifier with the MAIL command.

The following example sends the file MEETING.TXT to the user THOMAS and the distribution list FRIENDS.DIS:
$ MAIL/SUBJECT="update" MEETING THOMAS,"@FRIENDS.DIS"
The following example sends the file NOTICE.TXT to the distribution list WRITERS.DIS. Here, the /SUBJECT qualifier is not included so the message is sent without a subject notation.
$ MAIL NOTICE "@WRITERS"

7.6. Manipulating Files in Mail

You can send a file to other users from within Mail or from DCL level. Use the following procedure to send a file from within Mail:

Step

Task

1

At the MAIL> prompt, enter SEND and the name of the file you want to send.

2

At the To: prompt, enter the user name of the person you want to receive the file.

3

At the Subj: prompt, enter the subject of the file.

4

Press Enter to send the file. To cancel the send operation, press Ctrl/C or Ctrl/Y. Ctrl/C keeps you within Mail; Ctrl/Y returns you to DCL level.

In the following example, the file MEMO.TXT is sent to user EDGELL:
MAIL> SEND MEMO.TXT
To: EDGELL
Subj: Another memo
When sending files though mail, note the following restrictions:
  • When files are copied using the COPY command, the operating system performs data-integrity checking. This check does not occur when sending a file through mail and can cause corrupted files to occur when sending foreign (such as executable) files.

  • Use discretion when sending large files. Users on some systems may not be able to receive large files (such as PostScript files).

7.6.1. Sending DDIF Files

If the file is a compound document structured according to the DIGITAL Document Interchange Format (DDIF) specification, Mail preserves the OpenVMS RMS file tags and DDIF semantics, for OpenVMS AXP Version 1.0 or VAX/VMS Version 5.2-2 or later systems only. If you try to send mail messages containing DDIF files to operating systems other than OpenVMS or to OpenVMS systems earlier than OpenVMS AXP Version 1.0 or VAX/VMS Version 5.2-2, Mail returns an error message.

7.6.2. Sending Files from DCL

When you send a file from DCL level, Mail is invoked but you do not enter an interactive session, nor do you see the MAIL> prompt. When the file is sent, you return to DCL level automatically. After you have typed the MAIL command with the appropriate qualifiers, press Enter to send the file or press Ctrl/C to cancel the send operation.

Note the following as well:
  • No wildcard characters are allowed in the file specification. If you omit the file type, the default file type is .TXT.

  • If you specify SYS$INPUT as the file specification, you are prompted for the text of the message (while still remaining at the DCL level). For more information on using SYS$INPUT, see Chapter 11, Defining Logical Names for Devices and Files.

  • When you are sending a file from DCL level, the argument to the optional /SUBJECT qualifier must be enclosed in quotation marks if it contains any spaces or nonalphanumeric characters.

In the following example, the file MEMO.TXT is sent to user EDGELL on node CHEETA from the DCL level:
$ MAIL/SUBJECT="Another memo" MEMO.TXT CHEETA::EDGELL
In the following example, the user is prompted to input the text of the message because the file name specified is SYS$INPUT:
$ MAIL SYS$INPUT:
To: ARMSTRONG
Enter your message below.  Press CTRL/Z when complete, or CTRL/C to quit:
The text of the message is here.
Ctrl/Z
$

7.6.3. Creating Files from Messages

To create a text file from a message, enter the EXTRACT command and the file name at the MAIL> prompt while you are reading the message. When you exit from Mail, the file is listed in your current directory (unless you specify another directory). If the file is a DDIF file, Mail preserves the OpenVMS RMS file tags and DDIF semantics (VAX/VMS Version 5.2-2 or later).

The mail header is composed of the From:, To:, and Subj: lines. To create a file that does not include header information, specify the /NOHEADER qualifier to the EXTRACT command. If the message has more than one header (for example, a forwarded message), only the topmost header is deleted.

Use the /APPEND qualifier to the EXTRACT command to copy a message to the end of an existing file. Use the /ALL qualifier to copy all the files in the current folder to an existing file.

In the following example, a file named DEC_MEETINGS.TXT is created from the mail message shown:
#1                  01-DEC-1999  14:12:27        NEWMAIL

From:  STONE::FELLINI
To:    Thompson
Subj:  Dates for December sales meetings

Sales meetings in December will be held on the following dates:
      Wednesday Dec. 8, 1999
      Tuesday   Dec. 14, 1999
      Monday    Dec. 20, 1999
      Thursday  Dec. 30, 1999
MAIL> EXTRACT DEC_MEETINGS.TXT
%MAIL-I-CREATED, DISK:[THOMPSON]DEC_MEETINGS.TXT
The following example shows how to create a file named JANUARY_MEETINGS.TXT containing the text of message number 3:
MAIL> READ 3
.
.
.
MAIL> EXTRACT/NOHEADER JANUARY_MEETINGS.TXT
%MAIL-I-CREATED, DISK1:[JONES]JANUARY_MEETINGS.TXT;1 created
MAIL>

7.6.4. Appending Files to Messages

To append a small file to the end of a mail message automatically, use the SET SIGNATURE_FILE command. The file you specify is automatically (by default) appended to every mail message you send using the ANSWER, FORWARD, MAIL, REPLY, or SEND command. An example of a signature file is a text file that is formatted as a business card, containing the user's company name, address, telephone number, and Internet address.

If you want to selectively append a file to a message or override the default signature file setting, use the /SIGNATURE_FILE[=file-name] qualifier with the ANSWER, FORWARD, MAIL, REPLY, or SEND command.

Use the SHOW SIGNATURE_FILE command to show whether you specified a default signature file. The SHOW ALL command also displays signature file information.

You can also set the default signature file at the DCL level by using the /SIGNATURE_FILE[=file-name] qualifier with the DCL command MAIL.

Note that when you create a mail message that includes a signature file, that message requires more temporary disk space than a conventional message because temporary files are created during the operation. After the message is sent, those temporary files are deleted.

When specifying the signature file name, also note the following:
  • If you do not specify a file type, the default is .SIG.

  • If you do not specify a directory, the Mail utility searches for the signature file in your mail directory.

In the following example, the file BUSINESS_CARD.SIG is designated as the default file that will automatically be appended to every mail message sent using the FORWARD, MAIL, REPLY, or SEND command.
MAIL> SET SIGNATURE_FILE BUSINESS_CARD.SIG
In the next example, the file GREETINGS.SIG is designated as the file that will automatically be appended to that specific reply instead of the default signature file.
MAIL> REPLY/SIGNATURE_FILE=GREETINGS.SIG

7.7. Other Ways to Send Messages

The following sections describe other ways to use the Mail utility to send messages.

7.7.1. Replying to Messages

To reply to a message you have received, use the following procedure:

Step

Task

1

Type REPLY at the MAIL> prompt and press Enter.

2

Enter your message and press Ctrl/Z to send the message or press Ctrl/C to quit.

In the following example, a reply is being sent to STONE::THOMPSON. Note that after the reply command is entered, Mail automatically displays the To: and Subj: prompts:
To: STONE::THOMPSON
Subj:  RE: Budget Meeting
Enter your message below. Press CTRL/Z when complete. CTRL/C to quit:

7.7.1.1. Replying to an Address Containing Nested Quotation Marks

In most cases, you can use the Mail command REPLY to reply to mail received from an address containing nested quotation marks. However, if your system does not have this capability, contact your system manager.

7.7.2. Forwarding Messages

To forward a mail message to other users, enter the FORWARD command at the MAIL> prompt after you have read the message. Mail prompts you for the name of the addressee and a subject line. After you enter the requested information, press Enter to send the message.

If you forward a message that consists of a .DDIF file, Mail sends the entire .DDIF file, including .DDIF semantics and the .DDIF tag, to the addressee.

In the following example, a message is forwarded to user STONE::JONES:
MAIL> FORWARD
To: STONE::JONES
Subj: FYI -  Status of proposed budget meeting

7.7.2.1. SET FORWARD Command

You can use the SET FORWARD command to redirect all mail messages sent to you to another account on another OpenVMS cluster or on another system entirely. Essentially this command creates an electronic forwarding address. Only set a forwarding address for accounts you do not want to check regularly. For example, you'd like to forward all your mail from your mail account on the OLD cluster to your mail account on the STAR cluster. After you log into OLD, enter the Mail utility and enter the following command:
MAIL> SET FORWARD STAR::SMITH
All messages sent OLD::SMITH will be automatically redirected to the mail account on node STAR. You can also set your forwarding address to an Internet mail address:
MAIL> SET FORWARD SMITH@Company.com

In this case, all mail sent to OLD::SMITH will be sent to SMITH@Company.com.

Always send a test message to the old account to confirm that the account is forwarding correctly. To avoid creating forwarding loops where mail messages forward infinitely and never arrive, never set an account to forward to itself or another forwarding account. Do not forward OLD::SMITH to OLD::SMITH. Do not forward OLD::SMITH to STAR::SMITH and then forward STAR::SMITH to OLD::SMITH.

To check where an account is forwarding, enter the following command:
MAIL> SHOW FORWARD
Your mail is being forwarded to STAR::SMITH.
To remove a forwarding address, enter the following command:
MAIL> SET NOFORWARD
MAIL> SHOW FORWARD
You have not set a forwarding address.
Confirm that you have removed the forwarding address and send the account a test message.

Note

In prior versions of the OpenVMS operating system, you had to specify an extra pair of quotation marks if you wanted them included with the SET FORWARD command because the command automatically removed the first pair. Starting with OpenVMS Version 7.0, you need not specify an extra pair of quotation marks because the SET FORWARD command no longer removes the first pair.

7.8. Organizing Messages

The following sections describe how to organize mail messages.

7.8.1. Creating Folders

To organize your mail messages, you can create your own mail files and folders. A mail file contains folders, and a folder contains mail messages. Each folder and file can contain any number of messages.

Typically, you organize your messages by creating folders rather than by creating mail files. As with the default mail folders (NEWMAIL, MAIL, WASTEBASKET), the folders you create are normally stored in the mail file MAIL.MAI. The name of the current folder is displayed in the top right corner of the screen each time you enter a READ or DIRECTORY command. You can work only with messages that are in your current folder.

If your mail file is very large (over 500 blocks), you might want to create separate mail files for the larger folders to improve Mail's performance.

7.8.2. Creating Mail Subdirectories

When you receive mail messages, they are written to files named MAIL$xxxxxxxxxx.MAI by default and are located in your top-level directory. Note that the x characters represent a long, random file specification. Your default mail file, MAIL.MAI, is created in your top-level directory the first time you receive a mail message.

To avoid the display of .MAI files in your top-level directory, use the Mail command SET MAIL_DIRECTORY. This command creates a mail subdirectory and moves all your .MAI files to that subdirectory. To move the .MAI files from a subdirectory back to your top level directory, use the SET NOMAIL_DIRECTORY command.

To display the name of the subdirectory that contains all your .MAI files, enter SHOW MAIL_DIRECTORY at the MAIL> prompt.

In the following example, a user (FRED) creates the directory .MAIL:
MAIL> SET MAIL_DIRECTORY [.MAIL]
MAIL> SHOW MAIL_DIRECTORY
Your mail file directory is SY$LOGIN:[FRED.MAIL]

7.8.3. Moving Messages into Folders

You can use either the FILE command or the MOVE command to place the current message in a different folder. If the folder does not exist, Mail displays a message asking if you want to create it. After filing the message in the specified folder, Mail automatically deletes the message from the current folder.

7.8.4. Copying Messages Between Folders

The Mail command COPY places a copy of the current message into the folder you specify. If the folder does not exist, Mail displays a message asking if you want to create it.

In the following example, all messages containing the word MEETING are copied from the current folder to a folder named SCHEDULE. After the COPY command completes, there are two copies of each message, one in the current folder and one in the folder named SCHEDULE.
MAIL> SEARCH MEETING
MAIL> COPY SCHEDULE
Folder SCHEDULE does not exist.
Do you want to create it (Y/N, default is N)?Y
%MAIL-I-NEWFOLDER, folder SCHEDULE created
The following command selects and displays the next message containing the word meeting:
MAIL> SEARCH

MAIL> COPY SCHEDULE
MAIL> SEARCH
%MAIL-E-NOTFOUND, no messages containing 'MEETING' found

7.8.5. Selecting Folders

To display a list of the folders in your current mail file, enter the DIRECTORY/FOLDER command. To select a new folder as your current folder, use one of the following commands:
  • SELECT foldername

    Selects the specified folder as the current folder. Subsequent Mail commands, such as READ and DIRECTORY, use the selected folder. You do not need to specify a folder name with each command.

  • SET FOLDER foldername

    This command works the same as the SELECT command.

  • DIRECTORY foldername

    Selects the specified folder as the current folder and lists the messages in the folder.

  • READ foldername

    Selects the specified folder as the current folder and displays the specified message (by default, the first message in the folder).

In the following example, the MEMOS folder is selected:
MAIL> DIRECTORY/FOLDER
Listing of folders in SYS$LOGIN:[FRED]MAIL.MAI;1
     Press CTRL/C to cancel listing
MAIL                                  MEETING_MINUTES
MEMOS                                 PROJECT_NOTES
STAFF

MAIL> SELECT MEMOS

7.8.6. Deleting Folders

To delete a mail folder, delete all the messages in the folder or move them to another folder. When you delete all messages in a folder, the empty folder is deleted automatically as soon as you select another folder.

In the following example, the messages in the MUSIC folder are deleted:
MAIL> SELECT MUSIC
%MAIL-I-SELECTED, 2 messages selected
MAIL> DELETE/ALL

7.8.7. Creating and Accessing Mail Files

You can also create files to organize your mail messages. You use the same commands to create a mail file that you use to create a folder: COPY, MOVE, and FILE. After Mail prompts you for the name of the folder, it also prompts you for a file name. If you enter a new file name at the File: prompt, a new mail file is created.

To work within a mail file other than the default mail file, use the Mail command SET FILE to specify the alternate file. The Mail command SHOW FILE displays the name of the current mail file. When you change mail files, the WASTEBASKET folder of the current mail file is emptied and deleted (if AUTO_PURGE is set) and the mail file is closed.

Figure 7.1, “Organizing Mail” shows how a typical user might organize their mail.

Figure 7.1. Organizing Mail
Organizing Mail
In the following example, the current message is moved into a folder named FEED in the ACCOUNTS file. The MOVE command creates the mail file ACCOUNTS.MAI, moves the current message into the FEED folder, and deletes the message from its current folder and file.
MAIL> MOVE
_Folder: FEED
_File: ACCOUNTS
In the following example, the FEED folder (which is in the ACCOUNTS file) is selected:
MAIL> SET FILE ACCOUNTS
MAIL> SET FOLDER FEED
MAIL> SHOW FILE
Your current mail file is SYS$LOGIN:[FRED.MAI]ACCOUNTS.MAI;1.

7.8.8. Correcting the Mail Message Count

If the number of new (unread) mail messages displayed on your screen is inconsistent with the actual number of new messages, enter the READ/NEW command when there is no new mail. You will know there is no new mail when you enter the READ/NEW command and receive one of the following system messages:
"%MAIL-W-NONEWMAIL, no new messages"
"%MAIL-E-NOMOREMSG, no more messages"

7.9. Deleting Messages

To delete a mail message from the current folder, either enter the DELETE command while you are reading the message or enter the DELETE command followed by the number (or range of numbers) of the message you want to delete. You can use either the hyphen (-) or the colon (:) to define the range of messages to be deleted.

In the following example, messages 4, 5, 6, 11, 12, 14, 15, 16, and 17 are deleted:
MAIL> DELETE 4-6,11,12,14:17

7.9.1. Recovering Deleted Messages

When you delete a message, the message is moved to a folder called WASTEBASKET. Deleted messages collect in the WASTEBASKET folder until you exit from the current mail file (either by exiting from Mail or by specifying a different mail file). If you have issued the SET AUTO_PURGE command, when you exit from the current mail file, WASTEBASKET is emptied and the folder itself is deleted. During your interactive Mail session, you can recover any deleted message by moving the message out of the wastebasket folder. You can also empty the WASTEBASKET folder by entering the PURGE command.

In the following example, the mail message identified by the number 12 is deleted and then recovered from the WASTEBASKET folder.
MAIL> DELETE 12

MAIL> SELECT WASTEBASKET
%MAIL-I-SELECTED, 1 message selected

MAIL> DIRECTORY
    # top
From                 Date         Subject

    1 FABLES::WEST         11-DEC-1999  Meeting this week

MAIL> MOVE MAIL

7.11. Protecting Mail Files

The following sections describe how to protect mail files.

7.11.1. Default Protection

Mail files (for example, MAIL.MAI) are protected so that no one else can read them and so that you cannot accidentally delete them. The protection code that Mail gives .MAI files is: (S:RW,O:RW,G:,W:). The system (including Mail itself) and the owner (you) can read and write to the file. The group and world are denied all access.

The Mail utility also has default file protection to discourage mail tampering. However, Mail is not completely secure from tampering. Anyone with sufficient privileges can change protection and access mail files.

7.11.2. Security Measures

Mail files are within your own directory, so you have the option of applying the file protection techniques for sensitive files described in Chapter 10, Controlling Access to Resources. In addition:
  • Use your judgment in responding to mail requests: if a node is outside your local OpenVMS Cluster environment, it is possible that the source node is incorrectly identified, either accidentally or intentionally.

  • It is best to use discretion in the content of your mail messages and in the selection of your audience.

  • Never reveal your password or send details about how to use your account. You have no control over information in a mail message once you have sent it.

7.12. Using Text Editors in Mail

The following sections describe how to use text editors in the Mail environment.

7.12.1. Using EVE

You can use a text editor to write a message before you send it. To do so, specify the /EDIT qualifier with the SEND command. After you respond to the To: and Subj: prompts, Mail invokes the text editor. Unless you have selected a different editor, Mail invokes the DECTPU-based EVE editor.

The [End of file] marker moves down as you enter text. For more information about the EVE editor, see Chapter 8, Editing Text Files with EVE. To send the message, press the Do key and enter the EXIT command. To cancel the send operation, press the Do key and enter the QUIT command.

In the following example, EVE is used to create a mail message:
MAIL> SEND/EDIT

[End of file]



Buffer:  MAIN                     |  Write  | Insert | Forward   

Note

Do not edit a .DDIF mail file because you will no longer be able to use the file as a .DDIF file. If you edit a .DDIF mail file, you can access only the text of the file.

7.12.2. Using /EDIT Qualifier Keywords

By specifying the /EDIT qualifier when you invoke Mail, you can use the editor for sending, replying, and forwarding during the ensuing mail session. You can also use keywords with the /EDIT qualifier to set the default for Mail.

To invoke the editor only when you are replying to a message, use the REPLY keyword with the MAIL/EDIT command. To invoke the editor and display the message to which you are replying, use the REPLY keyword with the =EXTRACT option. If you do not specify a keyword with /EDIT, the default is /EDIT=(SEND,REPLY).

To send or reply to a message, EXIT from the editor. To cancel a SEND or REPLY command, enter the QUIT command to exit from the editor.

Examples

In the following example, the editor will be invoked for every mail message that is sent or forwarded:
$ MAIL/EDIT=(SEND,FORWARD)
In the following example, the editor will be invoked for every message that is replied to:
$ MAIL/EDIT=(REPLY)
In the following example, the editor will be invoked and the message to which you are replying will be included as text every time you reply to a message:
$ MAIL/EDIT=(REPLY=EXTRACT)

7.12.3. Selecting an Editor

By default, Mail invokes the DECTPU-based EVE editor when you specify the Mail command SEND/EDIT. By entering the Mail command SET EDITOR, you can specify that a different editor be invoked instead of EVE. For example, to select the EDT editor, issue the Mail command SET EDITOR EDT. The EDT editor remains your default Mail editor (even if you log out of the system and log back in) until you enter another SET EDITOR command.

To display the name of the selected Mail editor, enter the Mail command SHOW EDITOR.

7.12.4. Using a Command File to Edit Mail

You can define the logical name MAIL$EDIT to be a command file before entering Mail. Then, when you issue any Mail command that invokes an editor, the command file will be called to perform the edit. In the command file, you can also invoke other utilities such as the spell-checker and you can specify any function that can be done in a command file. Refer to Appendix B, Annotated Command Procedures for an annotated example of a MAILEDIT.COM command procedure and refer to Chapter 13, Introduction to Command Procedures and Chapter 14, Advanced Programming with DCL for more information on command files.

7.12.5. Overriding Your Selected Editor

If you wish to temporarily override your selected editor, you can define MAIL$EDIT to be the string "CALLABLE_" with the desired editor name appended. For example, to use callable EDT rather than callable EVE, you can type the following command:
$ DEFINE MAIL$EDIT CALLABLE_EDT

If you issue the SET EDITOR command during a session that was invoked with MAIL$EDIT defined, you override both your permanent selected editor and the current editor setting. To use the command file defined by MAIL$EDIT again, you must exit from Mail and restart it.

7.13. Using the Mail Keypad

You can use the numeric keypad on your keyboard to execute commands in Mail. Most keypad keys can execute two commands.

Figure 7.2, “Mail Utility Keypad” shows the Mail keypad. To enter the top command for each key shown, press the appropriate key. To enter the bottom command shown, press the PF1 key first, and then the desired function key.

Figure 7.2. Mail Utility Keypad
Mail Utility Keypad

To execute the Mail command SEND, press KP7. To execute the Mail command SEND/EDIT, press the PF1 key first and then press KP7.

7.13.1. Redefining Keypad Keys

You can redefine the keypad keys to execute Mail commands when you are in Mail. Note that the previous definition of the key is superseded when you redefine a key.

Defining keypad keys in Mail is similar to defining keypad keys to execute DCL commands.

In the following example, the key KP2 is defined as the Mail command PRINT/PARAM=PAGE_ORIENT=LANDSCAPE. After KP2 is defined, you can press it to display the PRINT/PARAM=PAGE_ORIENT=LANDSCAPE command:
MAIL> DEFINE/KEY KP2 "PRINT/PARAM=PAGE_ORIENT=LANDSCAPE"

7.13.2. Assigning Additional Key Definitions

To increase the number of key definitions available on your terminal, use the /STATE qualifier. You can assign many definitions to the same key as long as each definition is associated with a different state. State names can be any alphanumeric string. By specifying states, you can press a key once to enter a command and a second time to enter a qualifier.

In the following example, PF1 (pressed twice) is defined as DIRECTORY/FOLDER:
MAIL> DEFINE/KEY PF1 "DIRECTORY"/SET_STATE=FOLDER /NOTERMINATE
MAIL> DEFINE/KEY PF1 "/FOLDER" /IF_STATE=FOLDER /TERMINATE

Press PF1 twice to enter the command DIRECTORY/FOLDER. The /TERMINATE qualifier ends the command line so you do not need to press the Enter key.

7.13.3. Creating Permanent Key Definitions

Any keypad keys that you define during a Mail session are lost when you exit from Mail. To retain keypad key definitions from one Mail session to another, create a file containing key definitions (for example, MAIL$KEYDEF.INI) in your top-level directory. For example, the following MAIL$KEYDEF.INI file contains six key definitions:
DEFINE/KEY PF1 "DIRECTORY "     /NOTERMINATE    /SET_STATE=folder
DEFINE/KEY PF1 "/FOLDER"        /TERMINATE      /IF_STATE=folder
DEFINE/KEY PF2 "SELECT "        /NOTERMINATE    /SET_STATE=mail
DEFINE/KEY PF2 "MAIL"           /TERMINATE      /IF_STATE=mail
DEFINE/KEY PERIOD "READ "       /NOTERMINATE    /SET_STATE=new
DEFINE/KEY PERIOD "/NEW"        /TERMINATE      /IF_STATE=new
To execute these commands each time you invoke Mail, enter the following command line in your login command file (LOGIN.COM):
$ DEFINE MAIL$INIT SYS$LOGIN:MAIL$KEYDEF.INI

7.14. Summary of Mail Commands

This section contains a summary of all Mail utility commands. For complete information on qualifiers used with these commands, refer to online help.

See also Section 7.15, “MIME Utility” for information about using the MIME utility to read and compose MIME-encoded messages.

7.14.1. Reading Messages

Use the following commands to read messages:
  • BACK

    Displays the message preceding the current or last-read message when the last command issued was READ. When the last command issued was DIRECTORY, the BACK command displays the preceding screen of the directory listing.

  • CURRENT

    Displays the beginning of the message you are currently reading.

  • DIRECTORY [folder-name]

    Displays a list of the messages in the current mail file, including message number, sender's name, date, and subject.

  • ERASE

    Clears your terminal screen.

  • EXTRACT

    Places a copy of the current message into the specified output file. To copy a mail message to a folder in a Mail file, use either the COPY, FILE, or MOVE command.

  • FIRST

    Displays the first message in the current folder.

  • LAST

    Displays the last message in the current folder.

  • NEXT

    Skips to the next message and displays it.

  • READ [folder-name] [message-number]

    Displays your messages. Pressing the Enter key is the same as entering the READ command without parameters.

  • SEARCH search-string

    Searches the currently selected folder for the message containing the first occurrence of the specified text string.

  • SHOW NEW_MAIL_COUNT

    Displays the number of unread mail messages.

7.14.2. Exchanging Messages

Use the following commands to exchange messages:
  • ANSWER [filespec]

    REPLY [filespec]

    Sends a message to the sender of the message you are currently reading or of the one you last read.

  • FORWARD

    Sends a copy of the message you are currently reading (or have just read) to one or more users.

  • MAIL [filespec]

    SEND [filespec]

    Sends a message to one or more users.

7.14.3. Removing Messages

Use the following commands to remove messages:
  • DELETE [message-number]

    Deletes either the message you are currently reading, a range of messages, or the message you just read, and moves it to the WASTEBASKET folder.

  • PURGE

    Deletes all the messages in the WASTEBASKET folder. When you exit from Mail or enter a SET FILE command (to select a new mail file), an implicit purge is done to empty the WASTEBASKET folder, unless you have previously entered the SET NOAUTO_PURGE command.

  • SET [NO]AUTO_PURGE

    Determines whether Mail empties the WASTEBASKET folder when you enter the EXIT or SET FILE command. When you use the SET NOAUTO_PURGE command, you must enter the PURGE command periodically to delete the messages in the WASTEBASKET folder.

  • SHOW AUTO_PURGE

    Displays whether messages in the WASTEBASKET folder are deleted (purged automatically) when you enter the EXIT or SET FILE command.

7.14.4. Printing Messages

Use the following commands to print messages:
  • PRINT

    Adds a copy of the message you are currently reading to the print queue. The files created by the PRINT command are released to the print queue when you exit from Mail. Multiple messages are concatenated into one print job unless you use the /NOW or /PRINT qualifier.

  • SET [NO]FORM form-name

    SHOW FORM

    Sets the default print form for printing done within Mail. The SET NOFORM command clears the default print form. The SHOW FORM command displays the default print form.

  • SET [NO]QUEUE queue-name

    SHOW QUEUE

    Sets the default print queue to be used when you enter the PRINT command from within Mail. SET NOQUEUE clears the previously defined print queue and sets the queue to SYS$PRINT, the default print queue. The SHOW QUEUE command displays your default print queue.

7.14.5. Organizing Messages

Use the following commands to organize messages:
  • COPY folder-name [filename]

    Copies a message to another folder without deleting it from the current folder. If the specified folder does not exist, it is created.

  • FILE folder-name [filename]

    MOVE folder-name [filename]

    Moves the current message to the specified folder and deletes the message from the original folder.

  • SELECT [folder-name]

    SET FOLDER [folder-name]

    Establishes a set of messages that you can affect as a group. You can copy or move this set of messages from one folder to another. You can also read and delete, or search and extract a set of messages. In addition, you can use the SELECT and SET FOLDER commands to move from one folder to another.

  • SET FILE filename

    Establishes (or opens) another file as the current mail file. By default, your mail file is MAIL.MAI. If you use the COPY command, the FILE command, or the MOVE command to create other mail files (for example, JOKES.MAI or HISTORY.MAI), you can then use the SET FILE command to open the Mail files.

  • SHOW FILE

    Displays the name of the mail file that is currently open.

  • SHOW FOLDER [folder-name]

    Displays the current folder name.

  • SET WASTEBASKET_NAME folder-name

    Changes the name of the WASTEBASKET folder, which contains messages to be deleted. You can delete all the messages in the WASTEBASKET folder by entering the PURGE command. If AUTO_PURGE is set, when you enter the EXIT command, messages in the WASTEBASKET folder will be deleted. If AUTO_PURGE is set, you can avoid deleting messages in the WASTEBASKET folder by entering the QUIT command.

  • SHOW WASTEBASKET_NAME

    Displays the name of the WASTEBASKET folder.

  • SHOW DELETED

    Displays the amount of deleted message space in the current mail file.

7.14.6. Marking Messages

The following commands are used for marking messages:
  • MARK [message-number]

    Sets the current or specified message as marked. Marked messages are displayed with an asterisk (*) in the left column of the directory listing. To select or organize marked messages, use the SELECT command with the /MARKED qualifier.

  • UNMARK [message-number]

    Sets the current or specified message as unmarked. The asterisk (*) in the left column of the directory listing is deleted.

7.14.7. Customizing the Mail Environment

The following commands are used for customizing the mail environment:
  • DEFINE/KEY key-name string

    Defines a key to execute a Mail command. You can press the key to enter a command instead of typing the command name.

  • SHOW KEY [key-name]

    Displays the key definitions created by the DEFINE/KEY command.

  • EDIT [filename]

    Invokes your selected editor and enables you to edit a message before you send it.

  • HELP [topic]

    Displays information about Mail. To obtain information about individual commands or topics, enter HELP followed by the command or topic name.

  • SET [NO]CC_PROMPT

    Sets the default for determining whether the carbon copy (CC:) prompt appears when sending a message.

  • SET COPY_SELF command[,command]

    Sets the default for determining whether the SEND, REPLY, or FORWARD commands return to the sender a copy of the message being sent.

  • SHOW COPY_SELF

    Displays which command (SEND, REPLY, or FORWARD) automatically sends a copy of the message to you.

  • SET [NO]SIGNATURE_FILE

    Sets the Mail utility to append a signature text file to the end of a mail message automatically whenever you use the ANSWER, FORWARD, MAIL, REPLY, or SEND command.

  • SHOW SIGNATURE_FILE

    Displays information that shows whether you specified a default signature file and, if so, the name of that file. The SHOW ALL command also displays signature file information.

  • SET EDITOR editor-name

    Selects the text editor to be used when you edit a message (for example, with the Mail command SEND/EDIT). You can use any callable editor available on your system. This command overrides any definition that the command procedure MAIL$EDIT has set.

  • SHOW EDITOR

    Displays the name of your selected text editor.

  • SET [NO]FORWARD address

    Sets a forwarding address for your mail.

  • SHOW FORWARD

    Displays the name of your current forwarding address.

  • SET [NO]MAIL_DIRECTORY [.subdirectory-name]

    Specifies that all mail files (file type .MAI) be moved from your SYS$LOGIN directory to the specified subdirectory.

  • SHOW MAIL_DIRECTORY

    Displays the name of the device and directory containing all your .MAI files.

  • SET [NO]PERSONAL_NAME text-string

    Appends a text string to the end of the From: field of mail messages you send. You can fill this field with your full name or any other information. Note that your personal name must begin with a letter and may not have two consecutive spaces.

  • SHOW PERSONAL_NAME

    Displays the text string established with the SET PERSONAL_NAME command.

  • SHOW ALL

    Displays detailed information about your current Mail settings.

7.14.8. Exiting or Transferring Control

The following commands are used for exiting Mail or transferring control:
  • ATTACH [process-name]

    Permits you to switch control of your terminal from your current process to another process in your job. For example, while you are editing a file, you can use the SPAWN command to move to a subprocess (Mail) to read a new mail message. Then, you can enter the ATTACH command to move back to the editing session.

  • EXIT

    Exits from Mail. When you enter the EXIT command, any messages in the WASTEBASKET folder are deleted unless you have issued the command SET NOAUTO_PURGE. You can also exit from Mail by pressing Ctrl/Z.

  • QUIT

    Exits from Mail without emptying the WASTEBASKET folder (deleted messages are not destroyed unless you enter the EXIT command or press Ctrl/Z). The QUIT command performs the same function as Ctrl/Y.

  • SPAWN [command]

    Creates a subprocess of the current process. You can use the SPAWN command to leave Mail temporarily, perform other functions (such as displaying a directory listing or printing a file), and then return to Mail.

7.14.9. Mail File Compression

The following command is used for compressing mail files:
  • COMPRESS [filespec]

    Makes an indexed mail file smaller. If you do not specify a file name, Mail compresses the mail file that is currently open. If there is no open mail file, Mail compresses the default mail file (MAIL.MAI).

7.14.10. System Management Commands

The following commands are used for system management:
  • REMOVE user name

    Removes a user record from the system's mail profile, data file SYS$SYSTEM:VMSMAIL_PROFILE.DATA. Requires SYSPRV privileges.

  • SHOW FORWARD

    Displays the name of a user's current forwarding address.

  • SHOW PERSONAL_NAME

    Displays the text string that a user has established with the SET PERSONAL_NAME command.

7.15. MIME Utility

The Multipurpose Internet Mail Extension (MIME) is the standard used to attach nontext files to mail messages. The MIME utility allows you to compose and read MIME-encoded mail messages. With MIME, nontext files, such as graphics or sound files, are encoded and sent as plain text, although that text may not be readable. The MIME utility decodes MIME files to their original form and allows you to create MIME-encoded files, which can be sent as mail messages using the OpenVMS Mail utility.

7.15.1. Invoking the MIME Utility

The system manager may have already set up the foreign command for MIME, but if not, you can do so by adding the following line to your LOGIN.COM:
$ MIME :== $SYS$SYSTEM:MIME.EXE

MIME will only open MIME encoded text files. You need to extract the MIME-encoded message into a text file using Mail first. See Section 7.6.3, “Creating Files from Messages” for instructions.

To invoke the MIME utility from the DCL prompt, enter the following:
$ MIME file-name.TXT
The file name qualifier is optional. If the file specified exists, it is opened READ_ONLY.
  • /READ_ONLY indicates that the file is the contents of a message received by the user who intends to decode it. This is the default.

  • /DRAFT indicates that the file contains a message that was created in a previous session and was opened for WRITE_ACCESS.

The MIME utility does not construct any header information such as the To: or From: fields. It creates only MIME headers and the body text of the message, saving the text in a file to be sent by Mail later. If the file specified to be opened contains such recognizable headers or any RFC822 headers, the file is opened and the default is /READ_ONLY.

If the file specified does not contain any recognizable headers or does not exist, an OPEN FILE ERROR message occurs.

You can establish system-wide defaults for displaying MIME-encoded messages by creating two files: MIME$MAILCAP.DAT and MIME$FILETYPES.DAT.

MIME$MAILCAP.DAT contains an application that defines each locally-recognized content type of MIME-encoded files. MIME$FILETYPES.DAT associates each content type with a file extension. A user can override the defaults by creating these files in SYS$LOGIN.

7.15.2. Initializing the MIME Utility

When a user starts the MIME utility, the initialization process performs the following steps:
  1. In the user's VMSmail profile, the MIME utility looks up the user's mail directory and default editor for use with the MIME utility.

  2. The MIME utility reads files MIME$MAILCAP.DAT and MIME$FILETYPES.DAT.

  3. The MIME utility refers to the following list of internal defaults:
    • Content types

      The MIME utility refers to the list of content types before displaying incoming messages. The list contains content types that the MIME utility recognizes and the information needed to decode each content type into its original format.

      The following is an example of a MAILCAP entry, from RFC 1524:
      image/*; xview %s

      You can add content types to the list MIME recognizes by creating a MIME$MAILCAP.DAT file. Example 7.1, “MIME$MAILCAP.DAT File” contains an example of a MIME$MAILCAP.DAT file.

    • File extensions

      The MIME utility refers to the list of file extensions while composing outgoing messages. The list contains OpenVMS file extensions and the content type associated with each extension. The MIME utility needs these extensions to be included in the MIME-formatted message body it composes.

      Each line in the file-extension list is made up of the following items:
      extension, content type/subtype, (optionally) Content-Transfer-Encoding string
      The following is an example of a line in a file-extension list:
      doc, application/ms-word, base64

      You can add file extensions and matching content types to the list the MIME utility recognizes by creating a MIME$FILETYPES.DAT file, which is described in Table 7.1, “MIME Utility Optional Files”.

7.15.3. Creating Optional MIME Utility Files

Table 7.1, “MIME Utility Optional Files” lists and describes files you might want to create to customize the MIME utility on your system.
Table 7.1. MIME Utility Optional Files

File

Purpose

MIME$MAILCAP.DAT

For the display and parsing of incoming messages.

MIME$FILETYPES.DAT

For the assignment of content types to outgoing attached files.

Place these files in the SYS$LOGIN directory.

7.15.3.1. MIME$MAILCAP.DAT File Processing

The format of the MIME$MAILCAP file originated in RFC 1524, A User Agent Configuration Mechanism for Multimedia Mail Format Information, by N. Borenstein, September, 1993. The MIME utility uses instructions in this file to interpret and display messages and attachments. By following these instructions, the MIME user agent calls external programs to display the content types found in MIME messages.

You can customize the MIME$MAILCAP.DAT file to specify a File Descriptor Language (FDL) for a specific content type to extract message parts on your system. Example 7.1, “MIME$MAILCAP.DAT File” contains an example of a MIME$MAILCAP.DAT file.

Note

References to program names must be logical names or valid file specifications.


Example 7.1. MIME$MAILCAP.DAT File
#
# MIME$MAILCAP.DAT
#
# Local customizations of content types and processing options
#
# Use xv.exe to display images
image/*; xv %s
#
# Use Netscape for html attachments
text/html; netscape %s
#

7.15.3.2. MIME$FILETYPES.DAT File Processing

The optional MIME$FILE_TYPES.DAT file contains lists of OpenVMS file extensions and the MIME content type associated with each one. ADD command processing uses the FILETYPE structure to designate the content type of an OpenVMS file to be attached to a composed message.

The syntax of the file format is similar to that of the MIME$MAILCAP.DAT file, with the # character indicating comments. Each line in the file contains a single file extension (without the leading '.'), followed by the content type and subtype to be associated with files that use that extension.

Optionally, the line can include the Content-Transfer-Encoding string (7bit, 8bit, Base64 or Quoted-printable), which is used to encode the contents of the file for transmission in the message. 7bit, 8bit, Base64 or Quoted-printable are the standard MIME encodings and the only ones accepted. If no encoding is specified, the MIME utility uses 7bit.

7.15.4. Extracting MIME-Encoded Files Using the MIME Utility

To extract a MIME-encoded file using the MIME utility, first, open the file you want to decode. You can open the file in one of two ways: by invoking the MIME utility specifying the file name or by opening the file in the MIME utility. EXTRACT extracts the specified attachment to a file in its native file format or in another format specified by the /FDL qualifier.

The following are typical MIME utility commands used to open a message file, display the message in readable text, and list the message attributes:
MIME> OPEN file-name
MIME> READ
MIME> LIST
To extract the attachment, enter the following command:
MIME> EXTRACT /ATTACHMENT=n destination-file-name

You can specify a single attachment by appending the /ATTACHMENT=n qualifier, which specifies the number of the attachment to be extracted. You can also use /FDL=filename, which specifies a File Descriptor Language (FDL) definition file to use when converting the specified attachment into an output file. The numbers for the individual attachments are displayed with the LIST command.

See Section 7.15.6, “MIME Utility Commands” for a complete list of commands used in the MIME utility.

7.15.5. Encoding Files Using the MIME utility

To encode files to be sent as attachments, you must first create a new file by invoking the MIME utility and specifying the NEW command. If the file name is not specified, NEW will prompt for a file name:
$ MIME NEW new-file-name
Or you can use the OPEN command in the MIME utility to open a draft message file:
MIME> OPEN/DRAFT file-name

To open a file that you created in a previous session, specify the qualifier /DRAFT in the command.

To add attachments to the file, enter the command:
MIME> ADD file-name

For a complete list of optional qualifiers for this command, see Section 7.15.6, “MIME Utility Commands”.

To write the current information to the file, use the SAVE command. Once saved, the MIME-encoded file can be sent as a file by the OpenVMS Mail utility.

To exit the MIME utility, enter the QUIT or EXIT command.

See Section 7.15.6, “MIME Utility Commands” for a complete list of commands used in the MIME utility.

7.15.6. MIME Utility Commands

The following list contains descriptions of the commands, parameters, and qualifiers available in the MIME utility. Examples follow each description.

ADD — Adds a new body part or attachment to the message being edited. The ADD command requires the name of the file you want to attach as a parameter. The optional qualifiers are:
  • /BINARY — Sets content type to "application/octet-stream" and content-transfer-encoding to "base64". This format can be used to represent an arbitrary binary data stream.

  • /CONTENT_TYPE=type — Overrides the default content type with a specified string, for example "IMAGE/JPEG."

  • /ENCODING_TYPE={7Bit|8Bit|Base64|Quoted-Printable} — Overrides the default encoding with a specified encoding type.

  • /MESSAGE — The attachment is a message file (standard RFC822).

  • /TEXT — The attachment is content type text.


MIME> ADD file-name/TEXT
CLOSE — Closes the current message file. If you have not saved your most recent changes, the MIME utility will prompt you to save before closing. If the file is /READ_ONLY, the file is left unchanged.
MIME> CLOSE
EDIT — Invokes the user's default text editor for the specified attachment.
MIME> EDIT attachment-number
EXIT — Exits the MIME editor, saving any work in process.
MIME> EXIT
EXTRACT — Extracts the specified attachment to a file in its native file format.
  • /ATTACHMENT=n — Specifies the number of the attachment to be extracted.

  • /FDL=filename — Specifies a File Descriptor Language (FDL) definition file to use when converting the specified attachment into an output file.


MIME> EXTRACT file-name/ATTACHMENT=n
HELP — Displays a help file for the MIME utility.
MIME> HELP
LIST — Displays information about the current message including a list of body parts and attributes, such as the attachment number.
MIME> LIST
NEW — Creates a new message.
MIME> NEW file-name
OPEN — Opens the message with the specified file name. The qualifiers available are:
  • /DRAFT — The message file is a draft created in a previous session.

  • /READ — The message is read-only and cannot be updated.


MIME> OPEN file-name/NEW 
QUIT — Aborts the current MIME editing session without saving the current message.
MIME> QUIT
READ — Displays the current message as readable text. Displays the attachment, if applicable.
MIME> READ
REMOVE — Deletes a specified attachment from the current message.
MIME> REMOVE 1
SHOW — Displays information about the MIME environment, depending upon what option is specified. Possible options are CONTENT_TYPE, FILE_TYPES, and VERSION.
MIME> SHOW option
SAVE — Writes the current message to a file. If a file name is specified, it will be used.
MIME> SAVE file-name

7.15.7. Error Handling

Error conditions are reported using the OpenVMS signaling subsystem, specifically lib$signal() and lib$stop(). Three levels of severity exist for error conditions: Fatal, Error, and Warning. These levels indicate what results you can expect from a condition. The severities and corresponding results are described in the following list:
  • Fatal (-F-) results in the immediate termination of the program.

  • Error (-E-) results in the termination of the currently active command while retaining the existing message context.

  • Warning (-W-) results in the completion of the current command, without interrupting the MIME editing session. However, this does not mean that the command accomplished all its tasks successfully. Check the results for errors.

Chapter 8. Editing Text Files with EVE

Text editors allow you to create and modify text files. With a text editor, you can enter text from a keyboard and modify the text using text editing commands. For example, you can type in data for a report and then rearrange sections, duplicate information, substitute phrases, or format text. You can use text editors to create and modify source files for programming languages. The operating system supports several text editors.

The Extensible Versatile Editor (EVE) is a general-purpose text editor based on the DEC Text Processing Utility (DECTPU). This chapter includes information about:
  • EVE features

  • Getting help

  • Beginning an editing session

  • Entering commands

  • Saving your edits and exiting from EVE

  • Moving the cursor

  • Entering text

  • Erasing and restoring text

  • Moving text

  • Copying text

  • Box editing

  • Using pending delete

  • Finding and replacing text

  • Using command line qualifiers

  • Alternate methods to invoke EVE

  • Journaling and recovery

  • EVE formatting commands

  • Using buffers

  • Creating a subprocess

For additional information about EVE, refer to online help in EVE and the Extensible Versatile Editor Reference Manual.

For information about EDT, refer to the OpenVMS EDT Reference Manual.

Conventions

In this chapter, EVE key names are shown (with the SHOW KEY or HELP KEYS command) by using a slash for control keys, shifted function keys, and Alt key combinations, and a space or a dash for GOLD key sequences. Thus, key combinations that require you to hold down one key (such as Ctrl) while pressing another key are shown with a slash; key combinations in which you press one key after another (such as GOLD-Help) are shown with a space or a dash.

8.1. EVE Features

DECTPU is a high-performance, programmable text processor. With EVE software, you can create and edit text files such as business letters, technical documents, and program source files.

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.

With EVE, you can do the following:
  • Create and edit text files such as letters, reports, program sources, and other documents.

  • Perform text formatting operations, such as erase, cut, paste, fill, find, replace, and paginate.

  • Use multiple buffers and windows to view and edit different files in the same editing session.

  • Define keys for editing operations, including learn sequences (to bind several commands or keystrokes to a single key) and setting the EDT keypad or WPS-PLUS keypad.

  • Select text in boxes or in linear ranges for cut-and-paste or other edits.

  • Use wildcards to search for patterns of text.

  • Execute DCL commands (such as DIRECTORY) from within the editor.

  • Run DECspell to check a selection or an entire buffer.

  • Spawn subprocesses or attach to other processes.

  • Compile and execute DECTPU procedures to extend EVE.

  • Add to or delete menu items from the DECwindows interface.

  • Save compiled procedures, menu definitions, key definitions, and other customizations for future sessions.

  • Use initialization files at startup or during an editing session.

  • Recover your work by using keystroke or buffer-change journaling when a system failure interrupts your editing session.

  • Get comprehensive online help on EVE commands, keys, menu items, and other topics, including DECTPU built-in procedures.

Once you know how to invoke EVE and how to enter commands, you can use EVE commands to create and edit files. Using editing keys and commands, you can move the cursor, set buffer mode, and perform editing operations such as entering, erasing, restoring, and moving text.

8.2. Getting Help

You can get online help at any time during your editing session. There are two kinds of online help available with the EVE editor:
  • Keypad help, which you access with the Help key on your terminal

  • EVE help, which you access with the HELP command at the EVE command prompt

8.2.1. Using Keypad Help

To access keypad help, follow these steps:
  1. Press the Help key.

    The Help utility displays a diagram of your keypad.

  2. Follow the directions on the screen to get information on:
    • EVE commands

      To get help on EVE commands, enter a command name or a question mark (?) and press the Enter key.

    • Defined keys

      To get help on a key that you have defined, press that key, or use the SHOW KEY command.

    • Listing key definitions

      To list all key definitions, type the word keys and press the Enter key, or press GOLD HELP. The GOLD key is the PF1 key or NumLock key on the numeric keypad.

  3. Press the Enter key to exit from Help.

8.2.2. Using EVE Help

To use the HELP command to access EVE Help, follow these steps:
  1. Press the Do key.

  2. Enter the command HELP.

    Use the Prev Screen and Next Screen keys to scroll through the list of available help topics.

  3. Press the Enter key to exit from Help.

To get information about a particular command, enter HELP followed by the command name and press the Enter key. The help text appears on the screen. You can also get help on DECTPU built-in procedures by entering the command HELP TPU.

The following example shows the help text for the MOVE BY LINE command:
MOVE BY LINE
Moves the cursor a line at a time in the current direction.
Keys: EVE                          Default VT100 Keypad
      -------------------------------------------------
      F12                               MINUS on keypad
Steps:
1. If necessary, set the direction to move in --- forward or reverse.
2. Use MOVE BY LINE (see key list above).
Usage notes:
o In forward direction, moves to the end of the current line, or to the
  end of the next line, if any.
o In reverse direction, moves to the start of the current line, or to
  the start of the next line, if any.
Related topics:
CHANGE DIRECTION   END OF LINE   LINE   START OF LINE

8.3. Beginning an Editing Session

EVE is the default editor for the OpenVMS operating system. The EDIT command, as follows, automatically starts the EVE editor (unless the default editor has been redefined by you or the system manager):
$ EDIT

On systems where EVE is not the default editor, start EVE with the EDIT/TPU command. When you begin an editing session, you can specify the name of an existing file or a new file you want to create. If you do not specify a file name, EVE prompts you for a file name when you end your editing session if you have added text to the default buffer called Main. See Section 8.18, “Using Buffers” for more information on using buffers.

The following example invokes EVE to create a new file named NEWFILE.DAT:
$ EDIT NEWFILE.DAT

[End of file]1



                               2




Buffer: NEWFILE.DAT              | Write | Insert | Forward 3
Command: 4
Editing new file. Could not find: FABLES.TXT 5
As you examine the EVE screen display, note the following:

1

The end-of-file marker marks the end of an EVE buffer. It is visible only on the screen and does not become part of your file. When you add text to the buffer, the end-of-file marker moves down. Depending on the length of your terminal screen, the marker may not be visible when you view the beginning of a buffer that contains many lines of text.

2

A window is an area of your screen that displays a buffer. EVE buffers exist only during the editing session. When you end an editing session, you can save your edits or discard them.

3

A highlighted status line appears at the bottom of the EVE window and provides information about the buffer you are viewing in the window. The status line shows the buffer name, editing status (write or read-only), current mode (insert or overstrike), and current direction (forward or reverse).

4

You use the command line to enter line-mode commands (see Section 8.4, “Entering Commands”). You get the command line by pressing the Do key.

5

The message window contains an informational message that appears beneath the highlighted status line when you invoke EVE and specify a file name on the command line. The message states either that the file is a new file or that a certain number of lines were read from an existing file. During the editing session, EVE displays other messages in the message window.

8.4. Entering Commands

There are two ways to enter EVE commands:
  • Type in commands on the command line interface.

  • Use defined keys on either the EDT or WPS keypad.

8.4.1. Typing Commands

To type a command, follow these steps:
  1. Press the Do key.

    The cursor moves to the command window and EVE prompts you to type a command.

  2. Type a command. You can abbreviate the command by using the first few letters of the command. EVE is not case sensitive. You can use any combination of uppercase and lowercase characters in the command line except when specifying strings for the FIND and REPLACE commands.

  3. Press the Do key or the Enter key.

    EVE executes the command or prompts you for further information.

8.4.2. Using Defined Keys

You can use defined keys to enter EVE commands. Each defined key performs one editing command. You can also define your own keys to perform EVE functions.

EVE defines some keys by default. The predefined keys on VT200, VT300, and VT400 series terminals include:
  • The mini-keypad (located between the main keyboard keys and the numeric keypad, above the arrow keys)

  • Certain function keys

  • Certain control key sequences

Control keys, arrow keys, and the Tab, Return, and Delete keys have the same definitions on all three types of terminal.

Figure 8.1, “EVE Keys — VT200, VT300, and VT400 Series Terminals” shows the predefined keys for the VT200, VT300, and VT400 series terminal.

Figure 8.1. EVE Keys — VT200, VT300, and VT400 Series Terminals
EVE Keys — VT200, VT300, and VT400 Series Terminals

On VT100 series terminals, EVE automatically defines most of the numeric keypad keys, the four arrow keys, and certain control keys. Figure 8.2, “EVE Keys — VT100 Series Terminals” shows the predefined keys for the VT100 series terminal.

Figure 8.2. EVE Keys — VT100 Series Terminals
EVE Keys — VT100 Series Terminals

8.5. Saving Your Edits and Exiting from EVE

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

8.5.1. Using the WRITE FILE Command

To save the text in your buffer by writing it to a file without exiting from EVE, use the WRITE FILE command. If no file is associated with your buffer, EVE prompts for a file name, as follows:
Type filename for buffer Main (press RETURN to not write it):

Type the name of the file and press the Enter key to write the buffer to a file.

8.5.2. Using the EXIT Command

To save your edited text, use the EXIT command. You can enter the EXIT command by pressing the F10 key or by pressing Ctrl/Z.

If you have modified the current buffer, EVE creates a new version of the file with the same file name and file type as the original version, with the version number incremented by 1. For example, if you use the EXIT command after modifying a file named FUN.DAT;1, the output file is named FUN.DAT;2.

8.5.3. Using the QUIT Command

To end a session without saving your edits, enter the QUIT command. Type YES (Y) and press the Enter key if you want to quit without saving the edits. If you change your mind and decide to save your edits, type N, press the Enter key, and use the EXIT command to exit from the buffer.

If you have modified buffers other than the current one, EVE asks if you want to save the contents of the other buffers. If you type Y, EVE creates a new version of an existing file, incrementing the version number by 1. EVE prompts for a file name if no file currently exists.

If no buffers have been modified, then EXIT and QUIT are the same. For example, if you use EVE to inspect a file without making edits, you can quit by pressing Ctrl/Z.

In the following example, there is a modified buffer named FUN.DAT and the QUIT command is entered:
Command: QUIT
Buffer modifications will not be saved, continue quitting (Y or N)?

8.6. Moving the Cursor

When editing files with EVE, you move the cursor where you want to perform an editing function. The more quickly and efficiently you move the cursor through the text, the more time you save in your editing session. You can use the keyboard or commands to move the cursor.

Table 8.1, “EVE Editing Keys That Move the Cursor” shows EVE editing keys that move the cursor. For more information about the GOLD key combinations listed, see the online help topic GOLD.
Table 8.1. EVE Editing Keys That Move the Cursor

Key or Key Sequence

Function

Up arrow key

Same as MOVE UP. Moves the cursor up one line. On VT100 series terminals, KP5 is also defined as MOVE UP.

Down arrow key

Same as MOVE DOWN. Moves the cursor down one line. On VT100 series terminals, KP2 is also defined as MOVE DOWN.

Left arrow key

Same as MOVE LEFT. Moves the cursor one character or column to the left. On VT100 series terminals, KP1 is also defined as MOVE LEFT.

Right arrow key

Same as MOVE RIGHT. Moves the cursor one character or column to the right. On VT100 series terminals, KP3 is also defined as MOVE RIGHT.

Ctrl/E or GOLD right arrow key

Same as END OF LINE. Moves the cursor to the end of the current line.

Ctrl/H or GOLD left arrow key

Same as START OF LINE. Moves the cursor to the beginning of the current line.

GOLD up arrow key

Same as TOP. Moves the cursor to the top of the current buffer.

GOLD down arrow key

Same as BOTTOM. Moves the cursor to the bottom of the current buffer.

GOLD Next Screen

Same as NEXT WINDOW. Moves the cursor to the last position the cursor occupied in the next window on your screen, if you are using two or more windows.

GOLD Prev Screen

Same as PREVIOUS WINDOW. Moves the cursor to the last position the cursor occupied in the previous window on your screen, if you are using two or more windows.

Table 8.2, “EVE Commands That Move the Cursor” shows EVE commands that move the cursor.
Table 8.2. EVE Commands That Move the Cursor

Command

Function

BOTTOM

Moves the cursor to the end of the current buffer. By default, EVE defines GOLD down arrow key as BOTTOM.

CHANGE DIRECTION

Changes the direction of the current buffer. The direction of the buffer is shown in the status line.

END OF LINE

Moves the cursor to the end of the current line. By default, EVE defines both Ctrl/E and GOLD right arrow key as END OF LINE.

FORWARD

Default setting. Sets the direction of the current buffer to forward; that is, to the right and down. The direction of the buffer is shown in the status line.

GO TO

Moves the cursor to the position you specify, as previously labeled with the MARK command.

LINE

Moves the cursor to the beginning of a line (specified by the line number).

MARK

Puts an invisible marker at the current position and associates it with the name you specify. Later, you can return to the marked position by using the GO TO command.

MOVE BY LINE

In forward direction: moves the cursor to the end of the current line or, if the cursor is already at the end of a line, to the end of the next line. In reverse direction: moves the cursor to the beginning of the current line or, if the cursor is already at the beginning of a line, to the beginning of the previous line. On VT200, VT300, and VT400 series terminals, EVE defines the F12 key as MOVE BY LINE. On VT100 series terminals EVE defines the Minus key on the keypad as MOVE BY LINE.

MOVE BY PAGE

Moves the cursor to the next or previous page break (form feed), depending on the current direction. If there is no page break in the current direction, the cursor moves to the bottom or top of the buffer.

MOVE BY WORD

In forward direction: moves the cursor to the beginning of the next word or, if the cursor is already at the end of a line, to the beginning of the next line. In reverse direction: moves the cursor to the beginning of the previous word or, if the cursor is already at the beginning of a line, to the end of the previous line.

NEXT SCREEN

Scrolls forward in the current buffer by the number of lines in the current window minus one. For example, if the current window is 12 lines long, the NEXT SCREEN command scrolls the cursor forward 11 lines. On VT200, VT300, and VT400 series terminals, EVE defines the E6 key (Next Screen) as NEXT SCREEN. On VT100 series terminals, EVE defines the KP0 key on the keypad as NEXT SCREEN.

NEXT WINDOW or OTHER WINDOW

Moves the cursor to the next window on your screen, if there is one. The cursor appears in the last location it occupied in that window. EVE defines GOLD Next Screen as NEXT WINDOW.

PREVIOUS SCREEN

Scrolls backward in the current buffer by the number of lines in the current window minus one. For example, if the current window is 12 lines long, the PREVIOUS SCREEN command scrolls the cursor backward 11 lines. On VT200, VT300, and VT400 series terminals, EVE defines the E5 key (Prev Screen) as PREVIOUS SCREEN. On VT100 series terminals, EVE defines the Period key on the keypad as PREVIOUS SCREEN.

PREVIOUS WINDOW

Moves the cursor to the previous window on your screen, if there is one. The cursor appears in the last location it occupied in that window. EVE defines GOLD Prev Screen as PREVIOUS WINDOW.

REVERSE

Sets the direction of the current buffer to reverse; that is, to the left and up. The direction of the buffer is shown in the status line.

SET CURSOR BOUND

Makes the cursor follow the flow of text. The cursor cannot move into an unused portion of the buffer. Similar to cursor behavior in EDT, WPS, and other editors.

SET CURSOR FREE

Default setting. You can move the cursor anywhere in the buffer and enter text there.

SET SCROLL MARGINS

Sets the top and bottom distances at which scrolling begins automatically as you move the cursor up and down. You specify these distances as numbers of lines or as a percentage of the window size. The default setting is 0; that is, scrolling starts when you move past the top or the bottom of the window.

SHIFT LEFT

Shifts the current EVE window to the left by the number of columns you specify. With SHIFT RIGHT and SHIFT LEFT commands, you can view the undisplayed portion of long lines of text without having to change the width of the window or use 132-column mode. The SHIFT LEFT command shifts the window only if you have used the SHIFT RIGHT command.

SHIFT RIGHT

Shifts the current EVE window to the right by the number of columns you specify. With SHIFT RIGHT and SHIFT LEFT commands, you can view the undisplayed portion of long lines of text without having to change the width of the window.

START OF LINE

Moves the cursor to the beginning of the current line. By default, EVE defines both Ctrl/H and GOLD left arrow key as START OF LINE.

TOP

Moves the cursor to the beginning of the current buffer (upper left corner). By default, EVE defines GOLD up arrow key as TOP.

Tutorial: Moving the Cursor in EVE

To move the cursor through a buffer:
  1. Invoke EVE and create the buffer SCHEDULE.DAT with the following command:
    $  EDIT SCHEDULE.DAT

    EVE puts the cursor at the top of the buffer and waits for you to enter text.

  2. Enter the following text.
    Schedule for 1 July
    10:00 AM meeting with supervisor
    Read and review memo from Sally
    Work on Pascal program

    The [End of file] marker moves down in the buffer as you enter text and the cursor is positioned at the end of the text you inserted.

  3. Enter the TOP command to move the cursor to the beginning of the file.

  4. Press Ctrl/E to move the cursor to the end of the first line of text. Ctrl/E works the same way in EVE as it does in DCL.

  5. Enter the BOTTOM command to move the cursor to the end of the buffer.

  6. Press the up arrow key to move the cursor up one line to the fourth line of text.

  7. Press the Change Direction key to change the current buffer direction to reverse.

  8. Press the Move by Line key to move the cursor to the beginning of the third line of text.

  9. Enter the command LINE 1 to move the cursor to the beginning of the first line of the buffer.

  10. To exit from EVE, press Ctrl/Z.

8.7. Entering Text

You can enter keyboard characters, entire files, and special nonprinting characters (such as control characters) into the buffer that you are currently editing. You can use the keypad or commands to enter text. You can also add text, files, and special characters to the buffer.

8.7.1. Adding Text

You can type characters at the keyboard and add them to the buffer at the current cursor position. The characters you type either supplement or replace existing characters, depending on whether the buffer is in insert or overstrike mode.

8.7.2. Including Files

You can add an entire file by pressing the Do key and entering the EVE command INCLUDE FILE. Type the file specification at the File to include: prompt and press the Enter key. Regardless of the current mode (insert or overstrike) of the buffer, EVE inserts the entire contents of the specified file into the buffer just before the line where the cursor currently appears.

You can use wildcards in the file specification. If there is more than one match for a file specification with a wildcard, EVE displays a list of choices and prompts you to provide a more complete file specification. If the specified file does not exist, EVE displays a message stating that it could not include the file.

8.7.3. Special Nonprinting Characters

You can use the QUOTE command to add special nonprinting characters by pressing Ctrl/V followed by the special character. For example, to insert an escape character into the buffer, press Ctrl/V followed by Ctrl/[. The special character either supplements or replaces existing characters, depending on whether the buffer is in insert or overstrike mode.

8.7.4. EVE Editing Keys for Entering Text

The following table shows the EVE editing keys that you can use to enter text:

Key or Key Sequence

Function

Ctrl/A

Same as the CHANGE MODE command. Changes the editing mode for the current buffer as shown in the highlighted status line. In insert mode, EVE inserts text at the character position, moving existing text to accommodate the insertion. In overstrike mode, EVE overwrites text at the current position. On VT200, VT300, and VT400 series terminals, EVE defines the F14 key as CHANGE MODE. On VT100 series terminals, EVE defines the Enter key on the keypad as CHANGE MODE.

Ctrl/V

Same as the QUOTE command. You can insert nonprinting characters or control codes. To search for special characters, first press the Find key, then press Ctrl/V and the special character to be found. Activate the search by pressing the Enter key.

8.7.5. EVE Commands for Entering Text

The following table shows the commands that you can use to enter text:

Command

Function

CHANGE MODE

Same as Ctrl/A. Changes the current editing mode as shown in the highlighted status line. In insert mode, EVE inserts text at the current position, moving existing text to accommodate the insertion. In overstrike mode, EVE overwrites text at the current position. On VT200, VT300, and VT400 series terminals, EVE defines the F14 key as CHANGE MODE. On VT100 series terminals, EVE defines the Enter key on the keypad as CHANGE MODE.

INCLUDE FILE

Inserts the contents of the specified file into the current buffer at the line above the cursor position. This is useful for combining files.

INSERT MODE

Sets the mode of the current buffer to insert, as opposed to overstrike. In insert mode, EVE inserts text at the current position, moving existing text to accommodate the insertion.

OVERSTRIKE MODE

Sets the mode of the current buffer to overstrike, as opposed to insert. In overstrike mode, EVE overwrites text at the current position.

QUOTE

Same as Ctrl/V. Enters a nonprinting character or a control code that you specify by pressing a key. You can quote a control code or other character when you enter a string for the FIND or REPLACE commands. For example, you can quote the Tab key to search for tab characters.

8.7.6. Setting Buffer Mode

Before you begin typing text, check whether your buffer is in insert mode or overstrike mode.

To determine the mode your buffer is in, look at the highlighted status line. If the buffer is in insert mode, text is inserted at the cursor position and text that already appears in the buffer moves to accommodate your insertions. If the buffer is in overstrike mode, text that you type at the keyboard is inserted at the cursor position and the text that already appears in the buffer is overwritten as the cursor moves through it.

To change from one mode to another, press Ctrl/A.

Tutorial: Adding Text in Insert or Overstrike Mode

To add text to a file in both insert mode and overstrike mode:
  1. Invoke EVE to edit the existing file SCHEDULE.DAT.

  2. Check the highlighted status line to ensure that EVE is in insert mode.

  3. If EVE is in overstrike mode, press Ctrl/A to change to insert mode.

  4. Move the cursor to the first letter s in the word supervisor, type Engineering, and press the space bar.

    The word Engineering is inserted in your text buffer, and the rest of the text on the line moves to the right.
    Schedule for 1 July
    10:00 AM meeting with Engineering supervisor
    Read and review memo from Sally
    Work on Pascal program
    [End of file]
    Buffer: SCHEDULE.DAT           | Write | Insert | Forward
  5. Press Ctrl/A to change to overstrike mode.

  6. Move the cursor to the letter S in the word Sally and type Peggy.

    The word Peggy is placed in the buffer, overwriting the word Sally.
    Schedule for 1 July
    10:00 AM meeting with Engineering supervisor
    Read and review memo from Peggy
    Work on Pascal program
    [End of file]
    Buffer: SCHEDULE.DAT           | Write | Overstrike | Forward
  7. To exit from EVE, press Ctrl/Z.

8.8. Erasing and Restoring Text

With EVE, you can easily erase text or correct mistakes made during an editing session. If you erase text by mistake, you can restore the most recently erased text to its former location or, by moving the cursor, to another location.

To erase text from your buffer, move the cursor to the text you want to erase and press the appropriate editing key or enter the appropriate EVE command.

Table 8.3, “EVE Editing Keys for Erasing and Restoring Text” shows EVE editing keys that erase and restore text.
Table 8.3. EVE Editing Keys for Erasing and Restoring Text

Key or Key Sequence

Function

Delete key or Delete

Erases the character to the left of the cursor. Same as the DELETE command. If pending delete is enabled, DELETE erases text in the select range and puts it into the Restore Selection buffer. For more information about using pending delete, see Section 8.9, “Moving Text”.

Ctrl/J

Same as ERASE WORD. Erases the current word or, if the cursor is between words, erases the next word. On VT200, VT300, and VT400 series terminals, EVE defines the F13 key as ERASE WORD. On VT100 series terminals, EVE defines the Comma key on the keypad as ERASE WORD.

Ctrl/U

Same as ERASE START OF LINE. Erases characters left of the cursor to the start of the line.

GOLD Insert Here

Same as RESTORE. Reinserts, at the current position, the word, line, or sentence that you just erased with an EVE command or editing key.

GOLD F13

Same as RESTORE WORD (except with the WPS keypad). Reinserts, at the current position, the word that you last erased.

Table 8.4, “EVE Commands for Erasing and Restoring Text” shows EVE commands that erase and restore text.
Table 8.4. EVE Commands for Erasing and Restoring Text

Command

Function

DELETE

Erases the character to the left of the cursor. In insert mode, EVE moves existing text to accommodate the deleted character. In overstrike mode, EVE replaces the character with a space. At the start of a line, DELETE erases the carriage return for the previous line (regardless of mode) and the current line moves up. If pending delete is enabled, DELETE erases text in the select range and puts it into the Restore Selection buffer. For more information about using pending delete, see Section 8.9, “Moving Text”.

ERASE CHARACTER

Erases the character the cursor is on. In insert mode, EVE moves existing text to accommodate the deleted character. In overstrike mode, EVE replaces the character with a space. If the cursor is at the end of the line, the carriage return is erased—regardless of the mode—and the next line moves up.

ERASE LINE

Erases from the current character to the end of the line, appending the next line to the end of the current line. If the cursor is at the end of the line, only the carriage return is erased and the next line moves up.

ERASE PREVIOUS WORD

Erases the previous word or the word the cursor is on. If the cursor is between words or on the first character of a word, the previous word is erased. If the cursor is in the middle of a word, all of that word is erased (same as ERASE WORD). If the cursor is at the start of a line, the carriage return at the end of the previous line is erased and the current line moves up.

ERASE START OF LINE

Erases the current line of text, starting with the character left of the cursor until the start of the line. If you are already at the start of a line, nothing is erased.

ERASE WORD

Erases the current word or, if the cursor is between words, erases the next word. Same as Ctrl/J. On VT200, VT300, and VT400 series terminals, EVE defines the F13 key as ERASE WORD. On VT100 series terminals, EVE defines the Comma key on the keypad as ERASE WORD. If the cursor is at the end of the line, only the carriage return is erased and the next line moves up.

RESTORE

Reinserts, at the current position, the word, line, or sentence that you last erased with an EVE command or editing key. RESTORE does not restore single characters. EVE defines GOLD Insert Here as RESTORE.

RESTORE CHARACTER

Reinserts, at the current position, the character you last erased with an EVE command or editing key. In overstrike mode, the restored character replaces the character the cursor is on. In insert mode, the restored character is inserted at the cursor position and existing text moves to accommodate it.

RESTORE LINE

Reinserts, at the current position, the line that you last erased with an EVE command or editing key.

RESTORE SELECTION

Reinserts, at the current position, the text last erased with a pending delete operation. For more information about using pending delete, see Section 8.12, “Using Pending Delete”.

RESTORE WORD

Reinserts, at the current position, the word that you last erased with an EVE command or editing key. EVE defines GOLD F13 as RESTORE WORD (except with the WPS keypad).

Tutorial: Erasing and Restoring Text

To erase and restore text:
  1. Invoke EVE to create the buffer RHYMES.DAT and enter the following text:
    She rhymes with tree,
    also with bee,
    and this one makes three.
  2. Move the cursor to the letter l in the word also. Enter the ERASE LINE command.

    EVE erases all characters from the letter l in also to the end of the line and appends the next line to the current line.
    She rhymes with tree,
    aand this one makes three.
  3. Move the cursor to the letter y in the word rhymes. Enter the ERASE WORD command.

    EVE erases the word rhymes and shifts the remaining text to the left.
    She with tree,
    aand this one makes three.
  4. Move the cursor to the second letter a on the second line. Enter the RESTORE LINE command.

    EVE restores the last line that was erased, in this case, also with bee, .
    She with tree,
    also with bee,
    and this one makes three.
  5. Move the cursor to the letter w in the word with on the first line. Enter the RESTORE WORD command.

    EVE restores the last word that was erased, in this case, rhymes.
    She rhymes with tree,
    also with bee,
    and this one makes three.
  6. To exit from EVE, press Ctrl/Z.

Section 8.9, “Moving Text” describes the functions of the SELECT and REMOVE commands, which can be used together to erase text from a buffer.

8.9. Moving Text

You can use EVE commands to select sections of text for copying, moving, deleting, or other editing operations. This section discusses how to move text.

For information on how to move text from one buffer to another, see Section 8.18, “Using Buffers”.

You can also select a rectangular area (a box) of text rather than a linear range of text to move, erase, or duplicate text. For information about using box editing commands, see Section 8.11, “Box Editing”.

To move text, follow these steps:

Step

Task

1

Once you have invoked a file in EVE, place the cursor on the first character you want to move.

2

Press the Select key.

3

Move the cursor to one character beyond the last character you want to move. In reverse direction, move the cursor to the last character, not one beyond. The text to be moved is highlighted in reverse video. If you decide not to remove text from the buffer, press the Select key again to cancel the selection.

4

Press the Remove key. EVE deletes the highlighted text from your screen and places it in the Insert Here buffer.

5

Press the Insert Here key to insert text.

EVE inserts the text at the cursor location. You can insert the text contained in the Insert Here buffer any number of times at any cursor location until you select a new section of text and put that new text in the Insert Here buffer. The Insert Here buffer contains whatever text was last copied or removed.

Table 8.5, “EVE Editing Keys That Move Text” describes EVE editing keys used to move text.
Table 8.5. EVE Editing Keys That Move Text

Key or Key Sequence

Function

Insert Here

Same as the INSERT HERE or PASTE command. Inserts, at the current position, text that you removed or copied.

Remove

Same as the REMOVE or CUT command. Removes the text that is marked with SELECT or highlighted by FIND and places it in the Insert Here buffer.

Select

Marks text (highlighting it in reverse video) from the initial cursor location to wherever you move the cursor. The text that is highlighted is called the select range. To cancel the selection, press the Select key again or use RESET.

GOLD Select

Same as RESET. Cancels any of the following and resets the direction of the buffer to forward:
  • Highlighting of a select or found range

  • A press of the GOLD key (or GOLD n combination for a repeat count)

  • An incomplete or recalled command line, or Choices buffer display

  • The output of SHOW, SHOW DEFAULTS BUFFER, SHOW SUMMARY, or SHOW WILDCARDS, thereby returning you to the buffer you were working in

GOLD Remove

Same as the STORE TEXT or COPY command. Copies text that is marked with SELECT or FIND, putting it in the Insert Here buffer. Text that is copied is not removed from its original position.

Table 8.6, “EVE Commands That Move Text” describes EVE commands used to move text.
Table 8.6. EVE Commands That Move Text

Command

Function

INSERT HERE or PASTE

Inserts the text you copied or removed. By default, EVE defines the E2 key (Insert Here on the minikeypad on VT200, VT300, and VT400 series terminals) and the KP9 key (on VT100 series terminals) as INSERT HERE.

REMOVE or CUT

Removes the text that was marked with SELECT or highlighted by FIND, and places it in the Insert Here buffer. By default, EVE defines the E3 key (Remove on the minikeypad on VT200, VT300, and VT400 series terminals) and the KP8 key (on VT100 series terminals) as REMOVE.

RESET

Cancels any of the following and resets the direction of the buffer to forward:
  • Highlighting of a select or found range

  • A press of the GOLD key (or GOLD n combination for a repeat count)

  • An incomplete or recalled command line, or Choices buffer display

  • The output of SHOW, SHOW DEFAULTS BUFFER, SHOW SUMMARY, or SHOW WILDCARDS, thereby returning you to the buffer you were working in

RESTORE SELECTION

Reinserts the text erased by a pending delete operation. For more information about using pending delete, see Section 8.12, “Using Pending Delete”.

SELECT

Highlights text in reverse video from the initial cursor location to wherever you move the cursor. The text that is highlighted is called the select range. To cancel the selection, enter the SELECT command again or use RESET. By default, EVE defines the E4 key (Select on the minikeypad on VT200, VT300, and VT400 series terminals) and the KP7 key (on VT100 series terminals) as SELECT.

SELECT ALL

Highlights all text in reverse video in the current buffer regardless of the cursor position. The text that is highlighted is called the select range. To cancel the selection, enter the SELECT command or use RESET. The SELECT ALL command temporarily disables pending delete to avoid accidentally erasing all of the buffer.

SET NOPENDING DELETE

Default setting. Disables deletion of selected text when you use the Delete key or type new text. If you select text in the buffer, typing new text adds characters to the select range and using the Delete key erases only the character to the left of the cursor.

SET PENDING DELETE

Enables pending delete, which lets you quickly erase blocks of text. First enable pending delete, then use the SELECT command to choose the text you want to erase. Erase the text by pressing the Delete key (or any other key on the alpha-numeric keypad). To reinsert what you deleted, move the cursor to where you want the text and enter the RESTORE SELECTION command. The default is SET NOPENDING DELETE.

STORE TEXT or COPY

Copies text that was marked with SELECT or FIND, placing it in the Insert Here buffer. Text that is copied is not removed from its original position.

Tutorial: Moving Text

To select, remove, and insert text from one location to another:
  1. Invoke EVE to edit the file RHYMES.DAT.

  2. Move the cursor to the beginning of the second line of RHYMES.DAT and press the Select key.

  3. Press the down arrow key once.

    The second line of text is highlighted.

  4. Press the Remove key.

    The second line of text is removed from the current buffer.
    She rhymes with tree,
    and this one makes three.
    [End of file]
  5. Press the Enter key twice and then press the Insert Here key.

    The text in the Insert Here buffer is inserted at the current cursor location.
    She rhymes with tree,
    
    
    also with bee,
    and this one makes three.
    [End of file]
  6. To exit from EVE, press Ctrl/Z.

8.10. Copying Text

With the COPY command, you can copy text elsewhere. The STORE TEXT command is the same as the COPY command. You can substitute the STORE TEXT command wherever the COPY command is used in the following example.

Tutorial: Copying Text

To copy text when the buffer is set in a forward direction:
  1. Invoke EVE to edit the file RHYMES.DAT.

  2. Move the cursor to the first line of text.

  3. Press the Select key.

  4. Press Ctrl/E to move the cursor to the end of the first line.

  5. Enter the COPY command. The Insert Here buffer now contains a copy of the selected text.

  6. Move the cursor to the line above also with bee, .

  7. Press the Insert Here key. Your buffer should now look as follows:
    She rhymes with tree,
    
    She rhymes with tree,
    also with bee,
    and this one makes three.
    [End of file]
  8. Move the cursor to the beginning of the first line of text. Use the Select key and then the Remove key to delete the first line of text.

  9. To exit from EVE, press Ctrl/Z.

8.11. Box Editing

You can edit text that has rectangular areas, or boxes, as well as standard linear ranges. For example, you can select a box containing a list or columns in a table, and then cut and paste the box or perform some other editing operation on the box.

8.11.1. Selecting a Box of Text

To select a box of text, follow these steps:
  1. Put the cursor where you want to start the selection – typically, where you want the upper left corner of the box.

  2. Enter the BOX SELECT command.

  3. Move the cursor to where you want the diagonally opposite corner of the box — typically, moving from upper left to lower right.

As you move the cursor, text that you cross is highlighted in bold video (a regular selection uses reverse video). The box is defined by diagonally opposite corners. If you move from upper left to lower right, the character that the cursor is on is outside the box, that is, the lower right corner of the box is left of the cursor.

You can then edit the box by using any of the editing commands that ordinarily work on a linear or a rectangular range. You need not redefine keys. Refer to the Extensible Versatile Editor Reference Manual for further information.

You can use FIND SELECTED if the selection does not cross lines or OPEN SELECTED. You can also use pending delete.

If you are going to make several box edits – for example, in editing multicolumn tables and lists – use the SET BOX SELECT command. SET BOX SELECT redefines several commands and keys as the corresponding BOX commands and makes other editing operations work on boxes instead of linear ranges.

To cancel a box selection, repeat SELECT or BOX SELECT, or use RESET.

8.11.2. Cutting and Pasting a Box of Text

Cutting a box usually pads the area with spaces to keep the column alignment of text to the right of the box. Pasting a box usually overwrites existing text. Tab characters in the box, or that overlap the box, are converted to spaces to keep the column alignment of text.

Table 8.7, “EVE Commands for Box Editing” lists the EVE commands for box editing.
Table 8.7. EVE Commands for Box Editing

Command

Function

BOX COPY

Copies a box of text without removing it, so you can paste it elsewhere.

BOX CUT

Cuts a box of text so you can paste it elsewhere, usually padding the area with spaces to keep the column alignment of text to the right of the box.

BOX CUT INSERT

Cuts a box, making text to the right of the box collapse to the left, closing the gap.

BOX CUT OVERSTRIKE

Cuts a box, padding the area with spaces to keep the column alignment of text to the right of the box.

BOX PASTE

Pastes a box of text you copied or cut, usually overwriting existing text.

BOX PASTE INSERT

Pastes a box, pushing existing text to the right.

BOX PASTE OVERSTRIKE

Pastes a box, overwriting existing text.

BOX SELECT

Selects a box of text. Typically, you start at the upper left corner of the box and move the cursor to where you want the lower right corner.

RESTORE BOX SELECTION

Puts back (undeletes) a box erased with pending delete, usually overwriting existing text.

SET BOX NOPAD

Disables padding and overstriking for box editing unless the buffer is in overstrike mode.

SET BOX NOSELECT

Default setting. Disables box selection, cutting, and pasting. Commands such as SELECT, COPY, and REMOVE use standard linear ranges. To edit boxes, use BOX commands.

SET BOX PAD

Default setting. Enables automatic padding and overstriking for box editing, regardless of the buffer mode.

SET BOX SELECT

Enables box selection, making commands such as SELECT, REMOVE, and INSERT HERE the same as the corresponding BOX commands, without having to redefine keys.

Tutorial: Cutting and Pasting Text

To select and then cut and paste a box of text:
  1. Invoke EVE to create the buffer CITIES.DAT and enter the following text:
          Rome    Paris   New York
          London  Tunis   Boston
          Tokyo   Bonn    Lisbon
  2. Move the cursor to the left of the letter P in the word Paris. Enter the BOX SELECT command.

  3. Move the cursor two spaces to the right of the second letter n in the word Bonn—the diagonally opposite corner of the box. The text that you cross is highlighted in bold video. Enter the BOX CUT command.

    EVE removes the box of text.

  4. Move the cursor to the right of the column that begins with the words New York.

  5. Enter the BOX PASTE command.

    EVE pastes the box of text into a new column, as follows:
        Rome        New York     Paris
        London      Boston       Tunis
        Tokyo       Lisbon       Bonn
    [End of file]

8.11.3. SET BOX SELECT Commands

Table 8.8, “SET BOX SELECT Commands” lists the SET BOX SELECT commands.
Table 8.8. SET BOX SELECT Commands

Command

Effect with SET BOX SELECT

INSERT HERE or PASTE

BOX PASTE

REMOVE or CUT

BOX CUT

RESTORE SELECTION

RESTORE BOX SELECTION

SELECT

BOX SELECT

STORE TEXT or COPY

BOX COPY

You can then select, cut, and paste a box by using the Select, Remove, and Insert Here keys, without having to redefine the keys.

8.12. Using Pending Delete

You can use pending delete to erase selected text. Pending delete refers to erasing a selection by typing new text, pressing the space bar, or by using delete (typically, pressing the Delete key).

With a box selection, pending delete works like BOX CUT, usually padding the area with spaces to keep the column alignment of text to the right of the box.

Pending delete gives you an alternative way of cutting and pasting text because pending delete does not use the Insert Here buffer. For more information about pending delete, see the EVE online help topic called Pending Delete.

8.12.1. Erasing a Selection with Pending Delete

To erase a selection using pending delete, follow these steps:
  1. Invoke a file in EVE.

  2. To enable pending delete, use the SET PENDING DELETE command. The default setting is SET NOPENDING DELETE.

  3. Select the text you want to erase. You can use SELECT or BOX SELECT. You cannot use SELECT ALL.

  4. Type new text or use the DELETE command.

8.12.2. Restoring a Selection That Was Erased with Pending Delete

To put back (restore) the text you erased with pending delete, follow these steps:
  1. Put the cursor where you want to restore the text. If restoring a box selection, put the cursor where you want the upper left corner of the box to be.

  2. Use RESTORE SELECTION. If a box selection was erased with pending delete, use RESTORE BOX SELECTION. If you used SET BOX SELECT, you can use RESTORE SELECTION (without having to redefine a key).

Restoring a box works like BOX PASTE, usually overwriting existing text. When using the SET BOX NOPAD command, the effects of box editing depend on the mode that the buffer is in (insert or overstrike, as shown in the status line):
  • In insert mode, cutting a box makes text to the right of the box collapse to the left, closing the gap. Tab characters to the right of the box are also converted to spaces to keep the column alignment as the text collapses to the left. This method is useful for removing columns from a table or list, such as in turning a 4-column table into a 2-column table. Pasting a box pushes existing text to the right, which is useful for adding columns in the middle of a table.

  • In overstrike mode, cutting a box pads the area with spaces to keep the column alignment of text to the right of the box. Pasting a box overwrites existing text. The effects are the same as with SET BOX PAD, which is the default setting.

The buffer mode also affects erasing a box with pending delete and restoring an erased box.

8.13. Finding and Replacing Text

With EVE commands, you can search for specific text in a buffer. You can search for every occurrence of specific text, and you can search for text that is on a single line or spans a line break. Also, you can search for text using wildcards. This section describes methods for searching and replacing text.

Table 8.9, “EVE Commands for Locating Text in a Buffer” describes the EVE commands that locate text in a buffer.
Table 8.9. EVE Commands for Locating Text in a Buffer

Command

Function

FIND

Searches the current buffer for the text string you specify and highlights the found text. The text that is highlighted is called the found range.

FIND NEXT

Searches for the string of text you last specified with the FIND, REPLACE, or WILDCARD FIND command.

FIND SELECTED

Searches for a string of text you have selected, rather than for a typed string. The selection cannot cross more than one line.

SET FIND CASE EXACT

Enables case-exact searches. This is particularly useful to find or replace search strings in lowercase letters only.

SET FIND CASE NOEXACT

Default setting. Disables case-exact searches so that EVE finds any occurrence if you enter a search string in all lowercase letters.

SET FIND NOWHITESPACE

Default setting. Sets FIND and WILDCARD FIND commands to match tabs and spaces exactly as you specify in the search string and to search for strings that are entirely on one line.

SET FIND WHITESPACE

Sets FIND and WILDCARD FIND commands to treat spaces, tabs, and up to one line break as white space so you can search for strings of two or more words regardless of how they are separated.

SET WILDCARD VMS

Default setting on OpenVMS. Enables OpenVMS patterns for WILDCARD FIND.

SHOW WILDCARDS

Lists the wildcard patterns you can use with WILDCARD FIND.

WILDCARD FIND

Searches for a pattern of text, using wildcards.

8.13.1. Finding Text

Use the FIND command to locate specific text in the current buffer. By default, EVE defines the E1 key (Find key on VT200, VT300, and VT400 series terminals and the PF1 key on VT100 series terminals) as the FIND command.

If the search string contains all lowercase letters, EVE disregards the case of letters and locates any occurrence of the string. Thus, the search string the matches the, THE, THe, and thE. If the search string contains one or more uppercase letters, EVE finds only the occurrences of the string in which the case of each letter is exactly the same. Therefore, the only match for the search string tHis is tHis. For example:
  1. Enter the FIND command.

  2. Type the text (called the search string) that you want to locate.

The current direction of the buffer determines whether EVE first searches in a forward or reverse direction.

If EVE cannot find the string in the current direction but finds it in the opposite direction, EVE prompts you to change direction.

To search in the opposite direction, type YES (Y) and press the Enter key. EVE moves the cursor to the first occurrence of the string in the opposite direction. The current direction in the highlighted status line does not change, however.

8.13.1.1. When a Search String Is Found

When EVE finds the search string, the editor highlights it and moves the cursor to the first letter of the string. Refer to the Extensible Versatile Editor Reference Manual for a listing of the editing commands you can use on a highlighted search string.

To cancel the highlighting, move the cursor off the search string or use the RESET command.

To find the next occurrence of the search string, press the Find key twice or enter the FIND NEXT command.

8.13.2. Setting Case-Exact Searches

If you want to match the case of your search exactly when searching for lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then when you enter a search string in all lowercase letters, EVE searches only for lowercase occurrences, skipping occurrences that contain uppercase letters.

The setting applies to the FIND, REPLACE, and WILDCARD FIND commands. You can save the setting in your section file or command file for future editing sessions. The default setting is SET FIND CASE NOEXACT.

EVE is sensitive to diacritical (accent) marks and locates only those occurrences of the string in which the diacritical marks are exactly the same. For example, in searching for ë, EVE does not find occurrences of e, é, è, or ê.

In the following example, the commands enable case-exact searching and then find digital when it appears in lowercase only, skipping occurrences such as Digital or DIGITAL:
Command: SET FIND CASE EXACT
Command: FIND digital

Tutorial: Finding Text

To use the FIND command with the existing file RHYMES.DAT:
  1. Invoke EVE to edit RHYMES.DAT. The cursor appears on the first letter of the first line of the buffer, and the current direction is forward.

  2. Press the Find key, type the letters ree, and press the Enter key. The cursor moves to the letter r in the word tree and highlights the letters ree.

  3. Press the Find key twice to find the next occurrence of the string ree. The cursor moves to the letter r in the word three and highlights the letters ree.

    When a search string is found and highlighted, you can use any command that works on a selected or found range except SPELL. Also, you cannot use a pending delete operation on a found range.

  4. Enter the UPPERCASE WORD command.

    The UPPERCASE WORD command changes the case of the highlighted letters from lowercase to uppercase, as shown in the following example:
    She rhymes with tree,
    also with bee,
    and this one makes thREE.
    [End of file]

Tutorial: Using the FIND SELECTED Command

To use FIND SELECTED to search for a string that is particularly complicated or is easily misspelled or mistyped:
  1. Copy the text (from the previous tutorial) so that it is displayed twice in the buffer.

  2. Move the cursor to the beginning of the string rhymes with tree, on the first line.

  3. Enter the SELECT command.

  4. Move the cursor to highlight the string and select text. Note that the selection cannot span more than one line.

  5. Enter the command FIND SELECTED.

    The cursor moves to the next occurrence of the string rhymes with tree, . The selection is canceled and the found string appears in bold video.

8.13.3. Using Wildcards

You can use wildcards to search for text. The SHOW WILDCARDS command displays wildcard patterns for the current wildcard setting.

Tutorial: Using Wildcards

To learn how to use wildcards:
  1. Position the cursor at the beginning of the buffer.

  2. Enter the command WILDCARD FIND *ee to search for text strings ending in ee.
    She rhymes with tree,
    also with bee,
    and this one makes thREE.
    [End of file]

    EVE puts the cursor at the beginning of the line containing the r in tree.

8.13.5. Marking Locations in Text

The MARK and GO TO commands are useful for editing a large file and then returning to a specific location later in the editing session. The following table describes the MARK and GO TO commands:

Command

Function

MARK

Puts an invisible mark at the current cursor position. The mark exists for the rest of an editing session or until you change it; it is not saved when you exit.

GO TO

Returns the cursor to the location labeled by the MARK command. If the labeled location is found in another buffer, EVE moves the cursor to the other buffer and puts that buffer into the current window.

To mark your position, enter the MARK command followed by a label name of your choice. The label name can be one or more printable characters, including alphanumeric and punctuation characters, spaces, and tab characters. To return the cursor to the marked location, enter the GO TO command followed by the label name.

8.13.6. Replacing Text

With the REPLACE command, you can replace a text string in the current buffer with another text string. This is useful if you have spelled a word incorrectly throughout a long file and you want to fix every occurrence of the misspelled word.

8.13.6.1. REPLACE Command and Case Sensitivity

The REPLACE command is case sensitive. If the old string has any uppercase letters, EVE searches for exact case matches. If the old string is all lowercase, EVE searches for any occurrence of the string regardless of its case. If the new string has any uppercase letters, EVE replaces the string exactly. If the old and new strings are all lowercase, EVE replaces the string according to the following rules:
  • A capitalized version of the old string (first letter uppercase, others lowercase) is replaced by a capitalized version of the new string.

  • An all-uppercase version of the old string is replaced by an all-uppercase version of the new string (otherwise, the old string is replaced by an all-lowercase version of the new string).

The following table shows how EVE uses the case of the strings:

Old String

New String

Highlight

Replacement

butter

margarine

butter

margarine

Butter

Margarine

BUTTER

MARGARINE

BUtteR

margarine

Butter

margarine

Butter

margarine

butter

Margarine

butter

Margarine

Butter

Margarine

BUTTER

Margarine

BUtteR

Margarine

Butter

Margarine

Butter

Margarine

If you want to find or replace only lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then if you enter a search string in all lowercase, EVE searches for only lowercase occurrences, skipping occurrences that contain uppercase letters. The setting applies to FIND, REPLACE, and WILDCASE FIND commands.

The following table shows how EVE searches for and replaces only lowercase strings when you enter the SET FIND CASE EXACT command:

Old String

New String

Highlight

Replacement

butter

margarine

butter

margarine

The default case setting is SET FIND CASE NOEXACT.

8.13.6.2. REPLACE Command Responses

The following table shows the responses and their effect to the REPLACE command query:

Response

Effect

Yes

Replace this occurrence and find the next one. This is the default response. Press the Enter key.

No

Skip this occurrence and find the next one.

All

Replace all occurrences (no further prompting unless EVE finds an occurrence in the opposite direction).

Last

Replace this occurrence and stop here.

Quit

Skip this occurrence and stop here.

8.14. Using Command Line Qualifiers

When you invoke EVE, you can use command line qualifiers to specify advanced EVE editing features. When using the character-cell screen updater, the default insert or overstrike mode is determined by your terminal setting.

Table 8.10, “ EDIT Command Line Qualifiers” lists the qualifiers that you can use with the EDIT command to invoke EVE.
Table 8.10.  EDIT Command Line Qualifiers

Qualifier

Default

Command file

/COMMAND=TPU$COMMAND.TPU

File creation

/CREATE

Debugging package

/NODEBUG

Specifying display mode

/DISPLAY=CHARACTER_CELL

Initialization file

/INITIALIZATION=EVE$INIT.EVE

Journaling

/JOURNAL

Modifying main buffer

/MODIFY

Specifying output

/OUTPUT=output-file

Read-only access

/NOREAD_ONLY

Recovery

/NORECOVER

Section files

/SECTION=TPU$SECTION

Start position

/START_POSITION=(1, 1)

Work file

/WORK=SYS$SCRATCH:TPU$WORK.TPU$WORK

8.14.1. Starting in an Alternate Position

Start position qualifiers determine the row and column where the cursor first appears in the buffer that you specified on the command line.

For EVE, the default start position is 1, 1 – row 1, column 1, which is the upper left corner of the buffer. Use of start position qualifiers does not affect the initial cursor position when you create another buffer during the editing session and does not limit the buffer size.

The format of the start position qualifier is as follows:
/START_POSITION=(row[, column]
The fields are as follows:

/START_POSITION

You must use the /START_POSITION= qualifier to the EDIT command.

row

The row that you want the cursor to be at when you invoke EVE.

column

The column that you want the cursor to be at when you invoke EVE.

Use the start position qualifier to begin editing at a particular line (or row) or at a particular character position (or column). For example, when you want to skip over a standard heading in a file or if a batch log file or error message tells you there is an error on a given line of a program, you can specify that line number as the starting row so that when you edit the program source file, the cursor moves directly to that line. The following command edits a file named test.com and puts the cursor on line 10, column 5:
$ EDIT TEST.COM /START_POSITION=(10, 5)

If you want to start at a particular line in a file, you can omit the second parameter (the column).

8.14.2. Using Work Files

Work file qualifiers determine the work file that is used to swap memory for editing very large files. There is one work file per editing session. The work file is a temporary file that is automatically deleted when you exit.

The default work file is named TPU$WORK.TPU$WORK. EVE creates the work file in SYS$SCRATCH unless you specify otherwise.

There are two ways to specify a different work file:
  • Define the logical name TPU$WORK. This is useful if you want the work file to be created in an area other than SYS$SCRATCH, such as on a larger disk. You can put the definition in your LOGIN.COM file.

  • Use the /WORK= qualifier and specify the work file. This overrides any definition of the TPU$WORK logical name. For example, the following command invokes EVE and specifies the work file to be SYS$SCRATCH:MYWORK.TPU$WORK:
    $  EDIT /WORK=MYWORK

If you want the work file to be created in an area other than SYS$SCRATCH, use a complete file specification, including the device (disk) and directory. You cannot use wildcards to specify the work file.

8.14.3. Modifying the Main Buffer

Modifying qualifiers determine whether you can modify the buffers specified on the command line. Modifications do not affect other buffers you create during the editing session.

By default, you can modify the buffer by editing text in it. When you exit, EVE writes out the buffer to a file if the buffer has been modified.

Use /NOMODIFY to examine a file without making any changes. You can then use cursor-movement commands but you cannot change the text.

If you specify neither /MODIFY nor /NOMODIFY, your application determines if you can modify the buffer. EVE's default behavior is to modify the buffer.

Use /MODIFY to override the effect of /READ_ONLY or /NOWRITE. Use /MODIFY with /READ_ONLY or /NOWRITE to practice editing operations without writing a file on exiting. For example, the following command invokes EVE, making the buffer you specified on the command line read-only (or no-write) and making it modifiable:
$  EDIT /READ_ONLY /MODIFY

In EVE, you can set or change the modification attribute of the buffer by using SET BUFFER commands.

8.15. Alternate Methods to Invoke EVE

You can invoke EVE using four different methods: from search lists, with wildcards, with wildcard directory names, or with multiple input files.

8.15.1. Invoking EVE from a Search List

You can use a search list to invoke EVE to edit a file from that search list. For example:
$ DEFINE STAFFMEMOS HIRING.DAT, PROMOTION.LIS, SALARY.TXT
$  EDIT STAFFMEMOS

In the example, if the first file in the search list exists, EVE copies that file (HIRING.DAT) into a buffer and uses the file name and file type as the buffer name. If the file does not exist, EVE tries to get the second file (PROMOTION.LIS), and so on. If none of the files in the search list exist, EVE creates an empty buffer named HIRING.DAT because that is the first file in the search list.

8.15.2. Invoking EVE with Wildcards

When you invoke EVE to edit an existing file, you can use the asterisk (*) wildcard character as a substitute for some or all of the characters in the file name and file type. To use wildcards in EVE, follow the same rules as using wildcards in DCL. You can use the percent sign (%) wildcard character as a substitute for a single character at a time, and you can use the ellipsis ([...]) wildcard character as a substitute for a directory specification. If only one match is made, the file is displayed on your screen. If more than one match is made, EVE displays a list of matching files and prompts you to provide a more complete file specification. If no match is made, EVE creates a buffer named Main.

If more than one file matches your wildcard request, EVE displays the matching files so you can choose the one you want.

If no matching file is found, EVE creates an empty buffer named Main. If you use a search list or wildcard directory to specify an input file, EVE gets the first matching file found without displaying the $CHOICES$ buffer. For information about using the $CHOICES$ buffer, see the EVE online help topic called Choices Buffer.

In the following example, a list of all files with the file type .TXT will be displayed:
$ EDIT *.TXT

If you specify *.TXT, EVE lists the files that match your wildcard request in a second window in a system buffer named $CHOICES$.

8.15.3. Invoking EVE with Wildcard Directory Names

You can use wildcards in a directory name ([...]) to invoke EVE and work either in your current directory or in a subdirectory of the current directory.

This way of handling a search list or wildcard directory applies not only to the EDIT command, but also to EVE commands that use a file specification as a parameter. The following EVE commands use a file specification as a parameter:
  • @ (at sign)
  • GET FILE
  • INCLUDE FILE
  • OPEN
  • OPEN SELECTED
  • RECOVER BUFFER
In the following example, EVE searches through the directory tree and gets the first PINK.TXT file found, if there is one.
$  EDIT [...]PINK.TXT

8.15.4. Invoking EVE with Multiple Input Files

You can specify multiple input files on the command line that invokes EVE. The file names must be separated by commas with optional white space. If wildcard characters are present in the file names, EVE displays the matching files only for the first wildcard file name that has more than one match. For the other ambiguous file names, EVE outputs a warning message.

8.16. Journaling and Recovery

Journal files record your edits so that if a system failure interrupts your editing session, you can recover your work.

Buffer-change journaling creates a separate journal file for each text buffer you create. This is the EVE default. Buffer-change journaling works both on DECwindows and on character-cell terminals. You recover one buffer at a time, typically by using RECOVER BUFFER commands in EVE. You can recover buffers from different editing sessions. The recovery restores only your text – it does not restore settings, key definitions, or the contents of system buffers (such as the Insert Here buffer) before the system failure.

You can disable journaling when you invoke EVE by using the /NOJOURNAL qualifier on your command line. This is useful when you use EVE to examine a file without making any edits or for demonstration sessions.

EVE file backups are disabled and cannot be enabled because the OpenVMS file system provides version numbers; therefore, no EVE mechanism is needed.

8.16.1. Using Buffer-Change Journaling

Buffer-change journaling creates a journal file for each text buffer. EVE does not create buffer-change journal files for system buffers such as the Insert Here buffer, DCL buffer, or $RESTORE$ buffer. As you edit a buffer, the journal file records the changes you make, such as erasing, inserting, or reformatting text. When you exit from EVE or when you delete the buffer, the journal files are deleted. If a system failure interrupts your editing session, the journal files are saved. Your last few keystrokes before the system failure may be lost.

Table 8.11, “EVE Commands for Buffer-Change Journaling and Recovery” summarizes the EVE commands for buffer-change journaling and recovery.
Table 8.11. EVE Commands for Buffer-Change Journaling and Recovery

Command

Function or Effect

RECOVER BUFFER

Recovers a specified buffer by using the journal file for the buffer. You can specify the name of the buffer or file you want to recover or the name of the journal file for the buffer.

RECOVER BUFFER ALL

Recovers all your text buffers, one at a time, by using the journal files for the buffers, if there are any.

SET JOURNALING

Enables buffer-change journaling for a buffer that you specify.

SET JOURNALING ALL

Enables buffer-change journaling for all your buffers. This is the default setting.

SET NOJOURNALING

Disables buffer-change journaling for a buffer that you specify.

SET NOJOURNALING ALL

Disables buffer-change journaling for all your buffers.

Buffer-change journal files are written in a directory defined by the logical name TPU$JOURNAL. By default, this directory is SYS$SCRATCH, which is typically your top-level (login) directory. You can redefine the TPU$JOURNAL logical name to have the journal files written to a different directory. For example, the following commands create a subdirectory called [USER.JOURNAL] and then define TPU$JOURNAL as this subdirectory:
$ CREATE/DIRECTORY [USER.JOURNAL]
$ DEFINE TPU$JOURNAL [USER.JOURNAL]

You can put the definition in your LOGIN.COM file.

Buffer-change journal files may be quite large (even larger than the text files you edit). Because of the potential size of buffer-change journal files and because there is a journal file for each text buffer, you may want to define TPU$JOURNAL as a directory or subdirectory on a large disk, rather than as SYS$SCRATCH.

Deriving Buffer-Change Journal Names

Buffer-change journal file names are derived from the name of the file or buffer being edited and the default file type for the operating system. To find out the name of the journal file for the current buffer, enter the SHOW command at the EVE prompt. The SHOW command displays the name of your input file, output file, your journal file, and other information about your current buffer.

Table 8.12, “Buffer-Change Journal File Names” shows the buffer-change journal file names.
Table 8.12. Buffer-Change Journal File Names

Text Buffer Name

Buffer-Change Journal File

JABBER.TXT

JABBER_TXT.TPU$JOURNAL

GUMBO_RECIPE.RNO

GUMBO_RECIPE_RNO.TPU$JOURNAL

MAIN

MAIN.TPU$JOURNAL

LATEST NEWS

LATEST_NEWS.TPU$JOURNAL

Using Buffer-Change Journaling to Recover Edits

There are two ways to recover your edits with buffer-change journal files:
  • Use the /RECOVER qualifier on the EDIT command line when you invoke EVE.

  • Use RECOVER BUFFER commands within EVE.

In the following example, you are editing a file named JABBER.TXT when a system failure interrupts your editing session. You then use system recovery to recover your edits.
$ EDIT JABBER.TXT
              .
              .
              .
   ***  system failure  ***
              .
              .
              .
$  EDIT JABBER.TXT/RECOVER

Using the RECOVER BUFFER Command

To use the recover buffer command, follow this procedure:

Step

Task

1

Invoke EVE and enter the following command to recover your text:
Command: RECOVER BUFFER file-name.txt
If the buffer-change journal file is available, EVE shows the following information and asks if you want to recover that buffer:
  • Name of the buffer
  • Original input file for the buffer, if any
  • Output file for the buffer, if any
  • Source file for recovery, if any
  • Starting date and time of the editing session
  • Journal file creation date and time

2

Press the Enter key to recover your buffer.

If you do not want to recover your buffer, type No and press the Enter key. If you delete or rename the source file for recovery, the recovery fails. The source file is either the file initially read into the buffer (if any) or the last file written before the system failure.

If the buffer you want to recover exists (usually the Main buffer), EVE first deletes that buffer and then does the recovery. If the buffer you want to recover has been modified, EVE asks you whether to delete the buffer before recovering.

How to Recover When You Are Unsure of the File Name

If you are unsure of the buffer names or journal file names, specify the asterisk (*) wildcard, as follows:
Command: RECOVER BUFFER *

EVE then displays a list of all your available journal files so you can choose the one you want. The list appears in an EVE system buffer named $CHOICES$ in a second window. For information about using the $CHOICES$ buffer, see the EVE online help topic called Choices Buffer.

How to Recover All Buffers

To recover all your text buffers – one at a time – use the RECOVER BUFFER ALL command. EVE then tries to recover each text buffer for which there is a buffer-change journal available. The effect is the same as repeating the RECOVER BUFFER command without having to specify buffer names or journal file names. For each text buffer, EVE displays information such as the buffer name, the files associated with the buffer, and the time and date the journal file was created. EVE prompts you for one of the following:

Response

Effect

Yes

Recovers the buffer and then asks you whether to recover the next buffer, if there is one. This is the default response. Press the Enter key.

No

Skips this recovery. If there is another buffer to recover, EVE asks you about the other buffer.

Quit

Cancels – does not recover the buffer and does not continue recovery operations.

Disabling Buffer-Change Journaling

You can disable buffer-change journaling for a particular buffer by using the SET NOJOURNALING command. To disable buffer-change journaling for all your buffers, use the SET NOJOURNALING ALL command.

Enabling Buffer-Change Journaling

If you disabled buffer-change journaling, you can enable journaling by using the SET JOURNALING command. The following command enables journaling for a buffer named JABBER.TXT:
Command: SET JOURNALING JABBER.TXT

If you invoked EVE without journaling and then want to enable buffer-change journaling during the editing session, use the SET JOURNALING ALL command (which is the EVE default).

You cannot enable buffer-change journaling if the buffer has been modified. In such a case, EVE displays the following message:
Command: SET JOURNALING MEMO.TXT
Buffer MEMO.TXT is not safe for journaling

You should first write (save) the buffer by using the WRITE FILE or SAVE FILE command and then enable journaling.

8.17. EVE Formatting Commands

EVE provides commands that let you format your text by setting margins, tabs, and word wrap. You can center lines, take extra white space out of text, and insert page breaks.

Table 8.13, “EVE Editing Keys and Their Functions” shows EVE editing keys and describes their functions.
Table 8.13. EVE Editing Keys and Their Functions

Key or Key Sequence

Function

Return or Ctrl/M

Inserts a carriage return at the current position either to start a new line of text or to terminate a command you are typing. On VT200, VT300, and VT400 series terminals, EVE also defines the Enter key as Return.

Tab or Ctrl/I

Inserts a tab character at the current position according to the tab modes and at the tab stops currently set.

Ctrl/L

Inserts a form-feed character at the current position to mark the beginning of a new page. A page break appears as a small double F () and is always on a line by itself. Same as INSERT PAGE BREAK.

Table 8.14, “EVE Text Formatting Commands and Their Functions” shows EVE text formatting commands and describes their functions.
Table 8.14. EVE Text Formatting Commands and Their Functions

Command

Function

CAPITALIZE WORD

Changes the case of a word, making the first letter uppercase and the rest of the letters lowercase. Works on a range, box, or single word.

CENTER LINE

Centers the current line between the left and right margins. The cursor moves with the line, remaining on the same character as the line moves.

CONVERT TABS

Converts tab characters to the appropriate number of spaces in a box, a range, or the entire buffer.

FILL

Reformats the current paragraph, range, or box according to the margins of the buffer, so the maximum number of words fits on a line. When you fill a select range or found range, the FILL or FILL RANGE command does not reformat a line that begins with a page break, a DIGITAL Standard Runoff (DSR) command, or DOCUMENT tag; it does reformat the other lines in the range. Filling a range does not delete blank lines. For more information about select range, see Section 8.9, “Moving Text”.

FILL PARAGRAPH

Reformats the paragraph that the cursor is in according to the margins set for the buffer. When you fill a paragraph, the FILL command does not reformat a line that begins with a page break, DSR command, or DOCUMENT tag; it does reformat the other lines in the paragraph.

FILL RANGE

Reformats the range or box according to the current margin settings. When you fill a select range or found range, the FILL or FILL RANGE command does not reformat a line that begins with a page break, DSR command, or DOCUMENT tag; it does reformat the other lines in the range. Filling a range does not delete blank lines.

INSERT PAGE BREAK

Inserts a form-feed character at the current position to mark the beginning of a new page. A page break appears as a small double F () and is always on a line by itself. By default, Ctrl/L is defined as INSERT PAGE BREAK.

LOWERCASE WORD

Changes the current word, range, or box to lowercase.

PAGINATE

Inserts a soft page break for a 54-line page. A soft page break appears as a form feed followed by the null character (). When you enter the PAGINATE command, EVE moves back to the previous page break (if any) then checks ahead for page breaks within the next 54 lines. If any soft breaks are found within those 54 lines, EVE removes them. EVE then moves down 54 lines, inserts a soft break, and puts the cursor on the next line. The soft break is inserted on a line by itself. If a hard page break (form feed only) is found within the 54 lines, EVE stops on the line after the hard break, in case you want to erase the break.

SET LEFT MARGIN

Sets the left margin in the current buffer. The left margin must be greater than 0 but less than the right margin. By default, the left margin is 1 (leftmost column).

SET RIGHT MARGIN

Sets the right margin for the current buffer. The right margin must be greater than the left margin. By default, the right margin is one less than the width. The width is typically 80, so the default margin is typically 79.

SET PARAGRAPH INDENT

Specifies the number of spaces to be added to or subtracted from the first line of paragraphs you create or reformat. The default is 0 (no indent).

SET TABS AT

Sets tab stops at the columns that you specify. The column numbers must be in ascending order and separated by spaces. By default, tab stops are set every eight columns. The command does not affect the hardware tab settings of your terminal.

SET TABS EVERY

Sets tab stops at the specified interval. By default, tab stops are set every eight columns. The command does not affect the hardware tab settings of your terminal.

SET TABS INSERT

Default setting. Changes the tab mode so that EVE inserts a tab character at the current column when you press the Tab key. The cursor and text move to the next tab stop.

SET TABS MOVEMENT

Changes the tab mode so the Tab key becomes a cursor-movement key. Pressing the Tab key moves the cursor to the next tab stop but does not insert a tab character.

SET TABS SPACES

Changes the tab mode to insert an appropriate number of spaces, rather than a tab character, when the Tab key is pressed. Previously existing tab characters are not affected.

SET TABS INVISIBLE

Default setting. Makes tab characters invisible on the screen, appearing as white space.

SET TABS VISIBLE

Makes tab characters visible on the screen, appearing as a small (horizontal tab).

SET NOWRAP

Disables word wrapping at the right margin of the buffer. To start new lines, press the Enter key or use the FILL command.

SET WRAP

Default setting. Enables word wrapping at the right margin of the buffer. EVE starts new lines without you pressing the Enter key or using the FILL command.

UPPERCASE WORD

Changes the current word, range, or box to uppercase.

8.18. Using Buffers

Buffers are storage areas that exist only during an editing session. When you edit an existing file, EVE reads the contents of the file into a buffer. The highlighted status line contains the name of the buffer, its editing status (read-only or write), editing mode (insert or overstrike), and direction (forward or reverse).

Table 8.15, “EVE Commands to Manipulate Buffers” describes the EVE commands used to create, manipulate, and delete buffers.
Table 8.15. EVE Commands to Manipulate Buffers

Command

Function

BUFFER

Puts the specified buffer into the current window and moves the cursor to the last location it occupied in that buffer. If the specified buffer does not exist, creates a new buffer.

DELETE BUFFER

Deletes a buffer you specify by name.

GET FILE or OPEN

Puts the specified file into the current EVE window, creating a new buffer if necessary. If the file exists, EVE copies it into a new buffer in the current window. If the file does not exist, EVE creates a new, empty buffer, using the file name and file type for the buffer name. If there already is a buffer by that name, EVE asks for a different name to use.

GO TO

Returns the cursor to the location labeled by the MARK command. If the labeled location is found in another buffer, EVE moves the cursor to that buffer and puts it into the current window. Section 8.18.5, “Editing Multiple Buffers” explains how to use multiple buffers in an editing session.

INCLUDE FILE

Inserts the contents of the specified file into the current buffer at the line above the cursor location. This is useful to combine files.

NEW

Creates a new buffer named Main and puts it into the current window. If the buffer Main already exists, EVE asks for a name for the new buffer.

NEXT BUFFER

Puts the next buffer (if one exists) into the current window and moves the cursor to the last position it occupied in that buffer. This command lets you move from one buffer to another without specifying a buffer name.

OPEN SELECTED

Opens a file whose name you have selected or found. This command is the same as using the GET FILE or OPEN command without having to type the file name.

REMOVE or CUT

If you are in the Buffer List buffer, same as DELETE BUFFER. Use the REMOVE command as follows to delete a buffer without typing the buffer name: enter the SHOW BUFFERS command (which puts you in the Buffer List buffer), move the cursor to the name of the buffer you want to delete, and enter the REMOVE command.

SAVE FILE

Writes the contents of the current buffer to the file associated with the buffer without ending the editing session. If you do not specify a file name with the SAVE FILE command, EVE prompts you for an output file specification. Similar to WRITE FILE.

SAVE FILE AS

Writes the contents of the current buffer to the file you specify without ending the editing session. For example, if you are editing a file named FIRST.DAT, you can save it as SECOND.TXT. This command does not change the name of the buffer. It does, however, associate the buffer with the file you name so that any subsequent SAVE FILE, WRITE FILE, or EXIT command writes the buffer to the file you named. This command requires you to supply a file specification.

SELECT or RETURN

If you are in the Buffer List buffer, selects the buffer you specify. Use the SELECT command as follows to select a buffer without typing the buffer name: enter the SHOW BUFFERS command, move the cursor to the name of the buffer you want to select, and enter the SELECT command.

SET BUFFER

Lets you specify the editing status of the buffer: whether the buffer can be modified or can be written to a file when you exit from EVE.

SHOW

Displays information about the buffers you have created during the editing session. If more than one buffer is active in your editing session, the SHOW command displays information about the buffer you are currently editing. For information about the other active buffers, press the Do key. To resume editing, press any other key.

SHOW BUFFERS

Lists the buffers you have created during an editing session. You can move the cursor through the list and specify a particular buffer for viewing by pressing the Select key.

SHOW DEFAULTS BUFFER

Shows information, such as margins, tab stops, direction, mode, and maximum lines, about the EVE system buffer named $DEFAULTS$. These are the default settings used when you create new buffers.

SHOW SYSTEM BUFFERS

Lists the system buffers created by EVE, such as the Message buffer, Help buffer, Insert Here buffer, and $RESTORE$ buffer. You can move the cursor through the list and specify a buffer for viewing by pressing the Select key.

WRITE FILE

Writes the contents of the current buffer to the file associated with the buffer or to the file you specify on the command line without ending the editing session. If the current buffer does not have a file specification associated with it, EVE prompts you for an output file specification. Similar to SAVE FILE.

8.18.1. Obtaining Buffer Information

To display more information about the current buffer, enter the SHOW command. The information displayed includes whether the buffer has been modified, in addition to the following:
  • Buffer name

  • Names of the input, output, and buffer-change journal files

  • Current mode and direction

  • Number of lines

  • Margin and screen-width settings

  • Paragraph indent

  • WPS word wrap

  • Wrap indent

  • Tab stop

If more than one buffer is active during an editing session, EVE prompts you to press the Do key to get information about other buffers.

8.18.2. Deleting a Buffer

To delete a buffer, enter the DELETE BUFFER command and specify the name of the buffer you want to delete. If the buffer is empty or unmodified, EVE deletes it. If, however, the buffer has been modified, EVE prompts you for a choice. Note that the buffer name must be typed in full; no abbreviations are allowed. If you are viewing a buffer that you want to delete, EVE replaces the buffer with the oldest buffer existing in the editing session.

The following table lists the choices you can enter:

Keyword

Effect

DELETE_ONLY

Deletes the specified buffer.

WRITE_FIRST

Writes out (saves) the specified buffer, then deletes it.

QUIT

Default choice. The buffer is not deleted.

In the following example, deletion of the modified buffer MYFILE.TXT is requested:
Command: DELETE BUFFER MYFILE.TXT
That's a modified buffer. Type delete_only, write_first, or quit:

8.18.3. Changing Buffer Status

Use the SET BUFFER command to change the editing status of the buffer; that is, whether the buffer can be modified and whether the buffer will be written to a file after you exit from EVE.

You can specify one of the following SET BUFFER command keywords for each command:

Keyword

Effect

MODIFIABLE

Default setting. The buffer can be modified. Also restores the previous mode of the buffer (insert or overstrike).

READ_ONLY

The buffer is not saved (written out) on exiting, even if it has been modified (opposite of WRITE). Also sets the buffer to unmodifiable. However, you can set it to modifiable.

UNMODIFIABLE

The buffer cannot be modified. Also overrides the mode of the buffer (insert or overstrike).

WRITE

Default setting. The buffer is saved (written out) on exiting if it has been modified (opposite of READ_ONLY). If a buffer is read-only or unmodifiable, SET BUFFER WRITE makes it modifiable and restores its previous mode (insert or overstrike).

By default, buffer status is set to MODIFIABLE and WRITE, letting you change the contents of a buffer and save the changed buffer in a file.

To change the status of a buffer so that its contents cannot be inadvertently changed, set the buffer to READ_ONLY (which implies unmodifiable) with the following command:
Command: SET BUFFER READ_ONLY
To change the status of a buffer so it becomes a temporary storage area (a scratchpad), set the buffer to READ_ONLY and MODIFIABLE with the following commands:
Command: SET BUFFER READ_ONLY
Command: SET BUFFER MODIFIABLE

You then can edit the buffer, but it will not be saved when you exit from EVE.

8.18.4. Displaying the Messages Buffer

EVE uses the message window, which appears at the bottom of the screen, to communicate error and informational messages during an editing session. The message window displays the last message in the Messages buffer.

You can display these messages with the BUFFER command. To display the contents of the Messages buffer, press Do and enter the command BUFFER MESSAGES. To return to the buffer you were editing, press Do and enter the BUFFER command followed by the name of the appropriate buffer.

You can also enter the SHOW BUFFERS command to display the buffers you have created and press the Select key to choose a buffer.

8.18.5. Editing Multiple Buffers

You can use several buffers if you want to edit more than one file or if you want temporary storage areas for manipulating blocks of text. You can use one of the following commands to create a new buffer: GET FILE or OPEN, OPEN SELECTED, or BUFFER.

Using the GET FILE Command

To create a new buffer with a file that already exists, enter the GET FILE (or OPEN) command and the name of the file you want to copy to the new buffer. You can use the asterisk (*) wildcard character as a substitute for all or some of the characters in the file name and file type. You can use the percent sign (%) wildcard character as a substitute for one character in the file name and file type, and you can use the ellipsis ([...]) wildcard as a substitute for a directory specification.

Using the OPEN SELECTED Command

You can also use the OPEN SELECTED command to create a new buffer as follows:
  1. Put the cursor on the name of the file you want to open.

  2. Enter the OPEN SELECTED command.

Using the BUFFER Command

To put a specific buffer into the current EVE window, enter the BUFFER command and the name of the buffer you want to put in the current window. You cannot use wildcard characters in buffer names. The asterisk (*) and percent sign (%) are treated as literal characters in a buffer name. If the buffer you specify does not already exist, EVE creates a new buffer.

If the specified file exists, EVE reads the contents of the file into a new buffer and displays the buffer in the current window. If there is more than one match for a file specification with a wildcard, EVE displays a list of choices in the $CHOICES$ buffer and prompts you to provide a more complete file specification. EVE will open the first file it matches if you use a search list or an ellipsis ([...]) wildcard. Otherwise, EVE creates an empty buffer and displays the buffer in the current window.

To change the buffer in the current window, press the Do key, type BUFFER and the name of the buffer you want to display on the screen, and then press the Enter key. If you forget a buffer name, enter the SHOW BUFFERS command to display the names of active buffers in your editing session and specify a buffer with the Select key.

8.18.6. Reading Files into EVE

There are four ways to read a file into an EVE buffer:
  • Invoke EVE with a file specification.

  • Enter the INCLUDE FILE command and the name of the file you want to include. EVE reads the entire contents of the file into the buffer just before the line where the cursor is located. Using the INCLUDE FILE command does not change the name of the buffer on the status line.

  • Enter the GET FILE or OPEN command and the name of the file you want to use. Either command creates a new buffer and reads the contents of an existing file into the buffer. The name of the buffer on the status line is the same as the file name you specify with the GET FILE or OPEN command (see Section 8.18.5, “Editing Multiple Buffers”).

  • Select or find a file name, then enter the OPEN SELECTED command.

8.18.7. Writing Files from EVE

To write the contents of the current buffer to a file, enter the WRITE FILE command. You can include a file specification with the WRITE FILE command. If you do not include a file specification, EVE uses the input file specification to write the file. If you created the current buffer with the BUFFER or NEW command, EVE prompts you for a file specification to which it writes the file.

The following example shows how to use the output file associated with the buffer to write a buffer to the file:
Command: GET FILE RHYMES.DAT
    .
    .
    .
Command: WRITE FILE

3 lines written to WORKDISK:[USER]RHYMES.DAT;2

8.18.8. Using Windows

During an EVE editing session, the buffer you are editing is displayed on the screen in a window. A highlighted status line appears at the bottom of the window identifying the name, current editing mode, and current direction of the buffer.

EVE lets you view more than one window on your terminal screen at the same time. For example, you can have two windows on the terminal screen to view and edit different sections of the same buffer.

Table 8.16, “Keys Used with EVE Windows” describes EVE keys used to create and manipulate windows.
Table 8.16. Keys Used with EVE Windows

Key or Key Sequence

Function in a Window Environment

GOLD Next Screen

Puts the cursor in the next (or other) window. Same as the NEXT WINDOW command.

GOLD Prev Screen

Puts the cursor in the previous (or other) window. Same as the PREVIOUS WINDOW command.

Table 8.17, “EVE Window Commands” describes EVE commands used to create and manipulate windows.
Table 8.17. EVE Window Commands

Command

Function in a Window Environment

DELETE WINDOW

Deletes the current window, if you are using more than one window.

ENLARGE WINDOW

Enlarges the current window by a specified number of lines. For example, ENLARGE WINDOW 5 enlarges the window by five lines. The adjacent window shrinks accordingly.

NEXT WINDOW or OTHER WINDOW

Puts the cursor in the next (or other) window.

ONE WINDOW

Restores the current window as a single, large window. EVE deletes all other windows from the screen. The buffers associated with those windows are not deleted.

PREVIOUS WINDOW

Puts the cursor in the previous (or other) window.

SET WIDTH

Sets the width of lines displayed on the screen. Specify width as a positive integer. By default, the screen width is your terminal setting (usually 80 columns). If the width is set greater than 80, EVE sets the terminal to 132-column mode for the current editing session. When you exit from EVE, the terminal is restored to the default setting. Setting the width changes the display of text in all windows.

SHIFT LEFT

Moves the current window to the left a specified number of columns. You can use the SHIFT LEFT command only to reverse the effect of the SHIFT RIGHT command.

SHIFT RIGHT

Moves the current window to the right a specified number of columns, so you can view columns of characters that do not currently appear on the terminal screen.

SHRINK WINDOW

Shrinks the current window by a specified number of lines. For example, SHRINK WINDOW 5 shrinks the window by five lines. The adjacent window expands accordingly.

SPLIT WINDOW

Splits the current window, forming two smaller windows. You can divide the window into more than two parts by specifying a number with the command. For example, SPLIT WINDOW 3 splits the window into three windows.

TWO WINDOWS

Same as the SPLIT WINDOW 2 command.

8.18.9. Viewing Two Sections of One Buffer

To view two sections of a file at the same time, use the SPLIT WINDOW command. EVE splits your screen and creates two identical windows. The cursor maintains its position in the buffer but appears only in the bottom window. The buffer name is the same in both status lines.

Displaying two sections of a long file makes moving text within a file efficient. You can select and remove text from one part of the file and insert it into the other. To move the cursor from one window to the other, enter the NEXT WINDOW command.

To remove the second window from the screen and expand the current window to occupy the whole editing area, press the Do key, enter the command ONE WINDOW, and press the Enter key.

8.18.10. Editing Two Buffers

The following procedure describes how to edit two buffers containing different files:

Step

Task

1

Create two windows on your screen by entering the SPLIT WINDOW command.

EVE splits your screen and creates two windows. The cursor maintains its position in the buffer but appears only in the bottom window. The buffer name in each of the highlighted status lines is the same.

2

Use the GET FILE, OPEN, or OPEN SELECTED command to put a second file in the current window.

To display a buffer that you created earlier in the editing session in the current window, enter the BUFFER command and the name of the buffer you want to display.

Your terminal screen now displays two different buffers. You can select and remove text from one buffer and insert it into the other buffer. To move the cursor from one window to the other, enter the command NEXT WINDOW.

8.19. Creating a Subprocess

You can create a subprocess to switch between an EVE editing session and DCL command level without terminating your editing session. To create a subprocess, enter the SPAWN command. EVE suspends the current editing session and connects your terminal to a new subprocess. The DCL prompt ($) appears on your terminal screen.

8.19.1. Spawning

The most common reasons to spawn a subprocess are to invoke the Mail utility and to run screen-oriented programs, although your subprocess can invoke any OpenVMS utility or execute any DCL command.

To return to your editing session, log out of the subprocess by entering the DCL command LOGOUT. EVE resumes the editing session, and the cursor appears in the location it occupied before you spawned the subprocess. You can also supply a DCL command as a parameter to the SPAWN command to create a specific subprocess.

In the following example, the Mail utility is spawned from EVE:
[End of file]


Buffer: MAIN                           | Write | Insert | Forward
Command: SPAWN MAIL

The prompt for the Mail utility (MAIL>) appears on the screen. When you exit from Mail, you are automatically logged out of the subprocess and EVE resumes the editing session.

8.19.1.1. Spawning to EVE from DCL

Rather than spawn a process to use DCL, you can spawn a process for an EVE editing session and then attach to the parent DCL process to use DCL commands and utilities.

When you want to return to the DCL command level, use the EVE command ATTACH to return to the parent process.

To resume your editing session, reconnect to the editing subprocess by using the DCL command ATTACH with the process name of the subprocess.

In the following example, a subprocess is created using the DCL command SPAWN. The SPAWN command creates the subprocess SMITH_1. At the subprocess level, EVE is invoked and the editing session is conducted. At the end of the editing session, the ATTACH command is entered and you are returned to DCL. Then, to resume the editing session, the DCL command ATTACH is entered using the process name of the subprocess SMITH_1:
$ SPAWN
%DCL-S-SPAWNED, process SMITH_1 spawned
%DCL-S-ATTACHED, terminal now attached to process SMITH_1


[End of file]


Buffer: MAIN                        | Write | Insert | Forward
Command: ATTACH SMITH

$ ATTACH SMITH_1

Chapter 9. Sorting and Merging Files

This chapter describes how to use the OpenVMS Sort/Merge utility (SORT/MERGE). The Sort/Merge utility performs two operations:
  • Sorts records from one or more input files according to the fields you select and generates one reordered output file

  • Merges up to 10 (high-performance Sort/Merge utility supports up to 12) input files that have been sorted previously according to the same key fields and generates one output file.

Users can also choose the high-performance Sort/Merge utility, which provides better performance for most Sort and Merge operations. Refer to Section 9.1, “High-Performance Sort/Merge” for information.

This chapter describes:
  • High-performance Sort/Merge

  • Sorting files

  • Specifying collating sequences

  • Running Sort as a batch job

  • Merging files

  • Entering records from a terminal

  • Using a Sort/Merge specification file

  • Optimizing a Sort or Merge operation

  • Summary of Sort/Merge qualifiers

For additional information, see the following:
  • For information on commands used in this chapter, refer to the VSI OpenVMS DCL Dictionary: A–M and VSI OpenVMS DCL Dictionary: N–Z.

  • For information on how a system manager can improve efficiency when using the Sort/Merge utility, refer to the VSI OpenVMS System Manager's Manual, Volume 1: Essentials.

9.1. High-Performance Sort/Merge

Users can also choose the high-performance Sort/Merge utility, which provides better performance for most Sort and Merge operations.

The high-performance Sort/Merge utility uses the same command line interface as SORT/MERGE. Any differences between the high-performance Sort/Merge utility and SORT/MERGE are noted throughout this chapter.

Use the SORTSHR logical to select the high-performance Sort/Merge utility. Define SORTSHR to point to the high-performance sort executable in SYS$LIBRARY as follows:
$ DEFINE SORTSHR SYS$LIBRARY:HYPERSORT.EXE
To return to SORT/MERGE, deassign SORTSHR. The SORT/MERGE utility is the default if SORTSHR is not defined.

Note

Memory allocation differences may limit the high-performance Sort/Merge utility's ability to perform the same number of concurrent sort operations as the Sort/Merge utility can perform in the same amount of virtual memory.

If this situation occurs, you can either increase the amount of virtual memory that is available to the process, or reduce the working set extent. For information on using system parameters to change the amount of virtual memory or reduce the working set extent, refer to the VSI OpenVMS System Management Utilities Reference Manual.

The behavior of the high-performance Sort/Merge utility is the same as SORT/MERGE, except as shown in Table 9.1, “High-Performance Sort/Merge: Differences in Behavior”.

If you attempt to use an unsupported qualifier or assign an unsupported value to a qualifier, the high-performance Sort/Merge utility generates an error.
Table 9.1. High-Performance Sort/Merge: Differences in Behavior

Feature

High-Performance Sort/Merge Behavior

Key data types

The H-FLOATING and ZONED decimal data types are not supported.

The size of a BINARY data type key must be 1, 2, 4, or 8 bytes. A 16-byte binary key is not supported. Implementation of this feature is deferred to a future OpenVMS release.

Collating sequences

The National Character Set (NCS) collating sequences are not supported. Implementation of this feature is deferred to a future OpenVMS release. Do not specify the name of an NCS collating sequence for the /COLLATING_SEQUENCE qualifier. The ASCII, EBCDIC, and MULTINATIONAL collating sequences are supported. The default is ASCII.

You cannot define or modify your own collating sequence through the use of a specification file. Implementation of this feature is deferred to a future OpenVMS release.

Specification files

Specification files are not supported. Implementation of this feature is deferred to a future OpenVMS release. Do not use the /SPECIFICATION qualifier.

Internal sorting process

Only the record sort process is supported. Implementation of this feature is deferred to a future OpenVMS release. You can specify /PROCESS=RECORD or omit the /PROCESS qualifier. The TAG, ADDRESS, and INDEX values for the /PROCESS qualifier are not supported.

Statistical summary information

The following statistics are currently supported:
  • Records read
  • Records sorted
  • Records output
  • Input record length
The following statistics are unavailable:
  • Internal length
  • Output record length
  • Sort tree size
  • Number of initial runs
  • Maximum merge order
  • Number of merge passes
  • Work file allocation

Full implementation of this feature is deferred to a future OpenVMS release.

9.2. Sorting Files

To sort files, use the DCL command SORT. Specify the names of the files to be sorted, separated by commas, followed by the name of the ordered output file to be created.

Optionally, you can specify a key for each field on which you want to sort. Each key includes the following information:
  • Starting position of the key field in a record (required)

  • Size of the key (required)

  • Data type of the key

  • Order in which the records are sorted

  • Priority of the key

If you do not specify any keys, Sort assumes there is only one key and that this key field:
  • Begins in the first position of a record

  • Includes the entire record

  • Contains character data

  • Is sorted in ascending order

The following two examples use the default key.
  1. In this example, the file NAMES.LST is sorted in ascending order:
    $ SORT NAMES.LST BYNAME.LST

    This command creates the ordered output file BYNAME.LST, as shown in Figure 9.1, “List Sorted in Ascending Order”.

    Figure 9.1. List Sorted in Ascending Order
    List Sorted in Ascending Order
  2. In this example, the files NAMES.LST and NAMES2.LST are sorted into the ordered output file BYNAME.LST. Sort treats the files as if they were one large file:
    $ SORT NAMES.LST,NAMES2.LST  BYNAME.LST

See Section 9.9, “Summary of Sort/Merge Qualifiers” for a complete list of SORT qualifiers.

9.2.1. Defining a Key

Use the /KEY qualifier to define a key. When specifying multiple keys, use a separate /KEY qualifier for each key.

Table 9.2, “/KEY Qualifier Values” describes the five elements that comprise a key.
Table 9.2. /KEY Qualifier Values

Key Element

Value

Description

Key position

POSITION:n

The position of the first byte of the key field within the record. The first byte in a record is position 1. POSITION:n is required.

Key size

SIZE:n

The length of the key field. SIZE:n is required except for floating-point data.

The data type you specify for the key determines what values are acceptable when specifying size. The following table lists the possible values for each type of data and the units used to specify the size of the key.

Data

Valid Range

Units

Character1 through 32,767Characters
Binary1, 2, 4, 8, or 16 (for the high-performance Sort/Merge utility, the size of a binary data type key must be 1, 2, 4, or 8 bytes; support of a 16-byte binary key is deferred to a future OpenVMS release).Bytes
Decimal1 through 31Digits
Floating-pointNo value is necessary.

For decimal data, if the decimal sign is stored in a separate byte, that byte is not counted toward the size of the data.

If you specify a key that extends beyond the end of a record, Sort treats the missing characters as null characters.

Data type

CHARACTER

Character data. CHARACTER is the default data type.

BINARY

Binary data.

SIGNED – Signed binary or decimal data. SIGNED is the default for binary and decimal data.

UNSIGNED – Unsigned binary or decimal data.

F_FLOATING

F_FLOATING format data.

D_FLOATING

D_FLOATING format data.

G_FLOATING

G_FLOATING format data.

H_FLOATING

On VAX systems, H_FLOATING format data. Not currently supported by the high-performance Sort/Merge utility.

S_FLOATING

On Alpha systems, IEEE S_FLOATING format data.

T_FLOATING

On Alpha systems, IEEE T_FLOATING format data.

DECIMAL

Decimal data.

TRAILING_SIGN – Trailing sign decimal data. TRAILING_SIGN is the default for decimal data.

LEADING_SIGN – Leading sign decimal data. The leading sign must be in the first position of the field and the field must be left zero padded.

OVERPUNCHED_SIGN – Overpunched decimal data. OVERPUNCHED_SIGN is the default for decimal data.

SEPARATE_SIGN – Separate sign decimal data.

 

ZONED

Zoned decimal data. Not currently supported by the high-performance Sort/Merge utility.

 

PACKED_DECIMAL

Packed decimal data.

Sort order

ASCENDING

Orders the sorting operation in ascending alphabetical or numerical order. ASCENDING is the default order.

 

DESCENDING

Orders the sorting operation in descending alphabetical or numerical order.

Key priority

NUMBER:n

Specifies the order of priority of each key if you do not list multiple keys in the order of their priority. A value of 1 to 255 can be specified.

If the data in the key fields is not character data, you must specify the data type. The following data types are recognized by the Sort/Merge utility:

BINARY, [SIGNED]

BINARY, UNSIGNED

CHARACTER

DECIMAL, LEADING_SIGN, SEPARATE_SIGN [SIGNED]

DECIMAL, LEADING_SIGN, [OVERPUNCHED_SIGN, SIGNED]

DECIMAL [,SIGNED, TRAILING_SIGN, OVERPUNCHED_SIGN]

DECIMAL, [TRAILING SIGN], SEPARATE_SIGN, [SIGNED]

DECIMAL, UNSIGNED

D_FLOATING

F_FLOATING

G_FLOATING

H_FLOATING

S_FLOATING, IEEE (Alpha systems only)

T_FLOATING, IEEE (Alpha systems only)

PACKED_DECIMAL

ZONED

The items in brackets are defaults and need not be specified.

Note

For decimal string data, the Sort/Merge utility reports an invalid digit in the input string differently for VAX and Alpha systems. On VAX systems, you receive a message that the invalid digit (or reserved operand) is converted to a valid decimal string for comparison purposes. On Alpha systems, Sort/Merge performs the same conversion but does not display a message. In both cases, the data from the input file is written to the output file without change.

In Figure 9.2, “Record Fields in a List”, each record in the file EMPLOYEE.LST consists of three fields: (1) a department name, (2) an account number, and (3) an employee name.

Figure 9.2. Record Fields in a List
Record Fields in a List
The following examples illustrate how to sort the records in EMPLOYEE.LST both with, and without, a key field:
  1. In this example, EMPLOYEE.LST is sorted by account number, using the /KEY qualifier to describe the account number field:
    $ SORT/KEY=(POSITION:5,SIZE:4,DECIMAL)  EMPLOYEE.LST BILLING1.LST

    This command specifies that the key field (the account number) starts in position 5, is 4 characters long, contains decimal data, and should be sorted in ascending order (the default). Figure 9.3, “Sorting by Key Field” shows the results of this Sort operation.

    Figure 9.3. Sorting by Key Field
    Sorting by Key Field
  2. This example shows how to sort the file EMPLOYEE.LST without specifying a key field:
    $ SORT EMPLOYEE.LST BYDEPT.LST

    Because no key is specified, Sort assumes the default characteristics. Figure 9.4, “Sorting with Default Key Records” shows the result of this Sort operation.

    Figure 9.4. Sorting with Default Key Records
    Sorting with Default Key Records

    Sort treats each record in EMPLOYEE.LST as one key of character data. In this example, each record includes a department name, an account number, and an employee name. If Sort finds a duplicate department name, it sorts the names by account number. If it then finds a duplicate account number, it sorts by employee name. Note that the account number is part of the record. Unless you specify otherwise, it is treated as character data.

9.2.2. Multiple Key Fields

You can sort with more than one key (up to a limit of 255 keys). You can specify multiple keys in order of their priority with the primary key first, the secondary key next, and so on. Alternately, you can specify a key's priority using NUMBER:n. Each key can be ascending or descending.

In the following example, the file EMPLOYEE.LST is sorted by the employee name key first and then (where there are identical names), by the account number:
$ SORT /KEY=(POSITION:10,SIZE:15,CHARACTER) -
_$ /KEY=(POSITION:5,SIZE:4,DECIMAL) EMPLOYEE.LST BILLING2.LST

Figure 9.5, “Sorting with Multiple Key Fields” shows the results of this Sort operation.

Figure 9.5. Sorting with Multiple Key Fields
Sorting with Multiple Key Fields
In the following example, records are sorted first by the department name in descending order, then by the employee name in ascending order:
$ SORT/KEY=(POSITION:1,SIZE:3,DESCENDING) -
_$ /KEY=(POSITION:10,SIZE:15) -
_$ EMPLOYEE.LST BILLING3.LST

Figure 9.6, “Sorting with Multiple Key Fields (Ascending and Descending Order)” shows the results of this Sort operation.

Figure 9.6. Sorting with Multiple Key Fields (Ascending and Descending Order)
Sorting with Multiple Key Fields (Ascending and Descending Order)

9.2.3. Identical Key Fields

By default, Sort/Merge keeps records with identical key fields but does not necessarily maintain the same order in which they appeared in the input file. To control the way in which records with identical keys are sorted, specify one of the following qualifiers:
  • /STABLE

    Maintains the input order of records with identical keys. If you use this qualifier when sorting multiple input files, on output, records with equal keys in the first file precede those from the second file and so on.

  • /NODUPLICATES

    Retains only one copy of records with identical keys. If you want to specify which duplicate record to keep, invoke Sort at the program level and specify an equal-key routine.

The /STABLE and /NODUPLICATES qualifiers are incompatible. You cannot specify both qualifiers on the same command line.

In the following example, records with duplicate account numbers are eliminated from the file EMPLOYEE.LST:
$ SORT /KEY=(POSITION:5,SIZE:4)/NODUPLICATES EMPLOYEE.LST BUDGET.LST

Figure 9.7, “Sorting with Identical Key Fields” shows the results of this Sort operation.

Figure 9.7. Sorting with Identical Key Fields
Sorting with Identical Key Fields

9.2.4. Noncharacter Data

If you sort records that contain items other than character data, specify the data type of each key. In addition, take care in calculating starting positions and sizes because the items being compared can occupy more than 1 byte.

If you are sorting a file that contains 20 characters followed by 3 floating-point numbers in F_floating format, the positions are as follows:
  • The character data occupies positions 1 to 20 (20 characters).

  • The first F_floating-point number occupies positions 21 to 24.

  • The second F_floating-point number occupies positions 25 to 28.

  • The third F_floating-point number occupies positions 29 to 32.

To sort the file by the third floating-point number, specify the key field as follows:
$ SORT/KEY=(POSITION:29,F_FLOATING) STATS.RAW STATS.SOR

You do not need to specify the size of the floating-point number because it is fixed at four bytes.

9.2.5. Output File Organization

By default, Sort produces an output file with the same file organization as that of the first input file. To specify a different output file organization, include one of the following qualifiers after the output file specification on the Sort command line:
  • /FORMAT (record format)

    When you use this output qualifier, you can define the file record format, length, and block size.

  • /INDEXED_SEQUENTIAL

    Using this qualifier, you can define the output to have indexed sequential file organization. If you specify indexed sequential as the output file organization, you must also do the following:
    • Before you perform the Sort operation, create an empty file to be used as the output file. Sort requires an output file that already exists and is empty.

    • Include the /OVERLAY qualifier after the name of the output file on the SORT command line. The /OVERLAY qualifier indicates the existing file is to be overlaid with the sorted records of the input file.

  • /RELATIVE

    Using this qualifier, you can define the output to have relative file organization.

  • /SEQUENTIAL

    Using this qualifier, you can define the output to have sequential file organization.

In the following example, a sequential file is produced after the indexed sequential file EMPLOYEE.LST is sorted:
$ SORT/KEY=(POSITION:10,SIZE:15) -
_$ EMPLOYEE.LST BYNAME.LST/SEQUENTIAL

9.2.6. Sorting Process

Sort arranges files using one of the internal processes: record, tag, address, or indexed. The high-performance Sort/Merge utility supports only the record process. Implementation of tag, address, and index processes is deferred to a future OpenVMS release. The process you specify can affect the efficiency of the Sort operation. Refer to Section 9.8, “Optimizing a Sort or Merge Operation” for information about optimizing a Sort or Merge operation.

The following table describes the four types of process. Use the /PROCESS=type qualifier to specify the sort process.

Sort Process

type

Description

Record

RECORD

Keeps records intact while sorting and produces an output file consisting of complete records. Record is the default sorting process.

Tag

TAG

Sorts the key fields only and then rereads the input file to produce an output file of complete records. The net result is the same as for a complete record sort.

A tag sort is useful if disk space is low because it typically uses less work file space during the sorting. In most cases, a tag sort is slower than a record sort because it requires extra time to reread the input file.

Address

ADDRESS

Sorts the key fields only and produces an output file that is an index of record file addresses (RFAs) in binary format.

An address sort is faster than a record sort but you must write a program to associate the record addresses with the records of the input file.

Indexed

INDEX

Sorts the key fields only and produces an output file of keys and RFAs (in binary format).

As with an address sort, an index sort is faster than a record sort, but you must write a program to associate the record addresses with the records of the input file.

9.3. Specifying a Collating Sequence

Characters are sorted according to a collating sequence. For files that contain character data, you can use the /COLLATING_SEQUENCE=sequence qualifier to specify the collating sequence. The following table describes the collating sequence options:

Collating Sequence

sequence

Description

ASCII

ASCII

The default collating sequence for character data. The ASCII sequence orders numbers (0 to 9) first, then uppercase letters (A to Z), and then lowercase letters (a to z).

EBCDIC

EBCDIC

Generates an output file that is ordered in EBCDIC sequence. The data remains in the ASCII representation. The EBCDIC sequence orders lowercase letters (a to z) first, then uppercase letters (A to Z), and then numbers (0 to 9).

DEC Multinational character set

MULTINATIONAL

The multinational collating sequence collates characters according to the DEC Multinational character set (refer to Appendix A, Character Sets). In the MULTINATIONAL character sequence, characters are ordered according to the following rules:
  • All diacritical forms of a character are given the collating value of the character (A', A", A` collate as A).

  • Lowercase characters are given the collating value of their uppercase equivalents (a collates as A, a" collates as A").

  • If two strings compare as equal, tie-breaking is performed. The strings are compared to detect differences due to diacritical marks, ignored characters, or characters that collate as equal although they are actually different. If strings still compare as equal, another comparison is done based on the numeric codes of the characters. In this final comparison, lowercase characters are ordered before uppercase.

National character set (NCS)

Collating sequence name

The named collating sequence must be defined in an NCS library. For more information, see the OpenVMS National Character Set Utility Manual.

The high-performance Sort/Merge utility does not support the National Character Set (NCS) collating sequences. Support for NCS collating sequences is deferred to a future OpenVMS release.

User-defined sequence

(sequence-string)

Specifies a user-defined collating sequence. User-defined collating sequences are supported only through specification files and not through the command line interface.

The high-performance Sort/Merge utility does not support user-defined collating sequences. Support for user-defined collating sequences is deferred to a future OpenVMS release.

Define a collating sequence by specifying a string of single or double characters or ranges of single characters. A double character is any set of two single characters collated as if they were one character. For example, "CH" can be defined to collate as "C". This string should be enclosed in parentheses.

You can also represent characters by their corresponding octal, decimal, or hexadecimal values using the radix operators: %O, %D, %X.

You must observe the following rules when defining your collating sequence:
  • Enclose characters in quotation marks ("").

  • Separate each character and character range with a comma (,), and enclose the entire list in parentheses.

  • Give all the characters appearing in the character keys in the Sort or Merge operation a collating value. Any character not given a collating value will be ignored unless the FOLD or MODIFICATION options are specified.

  • Do not define a character more than once.

  • Do not specify the null character by using quotation marks (""). Instead, use a radix operator such as %X0.

  • Specify quotation marks by enclosing them within another set of quotation marks ("" "") or by using a radix operator.

The following string defines a collating sequence in which the double character LL collates as a single character between L and M.
("A"-"L","LL","M"-"Z")

Note

Exercise caution when using the multinational collating sequence to sort or merge files for further processing. Sequence-checking procedures in most programming languages compare numeric characters. Normal sequence checking does not work because the multinational sequence is based on actual graphic characters, not the codes representing those characters.

The following examples demonstrate the creation of user-defined collating sequences for use in specification files. See Section 9.7, “Using a Sort/Merge Specification File” for information about specification files.
  1. /COLLATING_SEQUENCE=(SEQUENCE=ASCII,IGNORE=("-"," "))
    This /COLLATING_SEQUENCE qualifier with an IGNORE option specified results in the following fields being compared as equal before tie breaking:
           252-3412
           252 3412
           2523412
  2. /COLLATING_SEQUENCE=(SEQUENCE=("A"-"L","LL","M"-"R","RR","S"-"Z"))

    This /COLLATING_SEQUENCE qualifier defines a sequence in which the double character LL collates as a single character between L and M, and the double character RR collates as a single character between R and S. These double characters would otherwise appear in their usual alphabetical order. By default, this user-defined sequence does not define any other characters, such as lowercase a to z.

9.4. Running Sort as a Batch Job

Batch jobs are programs or DCL command procedures that run independently of your current session. If you are sorting large files, consider submitting the Sort operation as a batch job because the sort will require some time. See Chapter 16, Understanding Processes and Batch Jobs, Chapter 13, Introduction to Command Procedures, and Chapter 14, Advanced Programming with DCL for more information about batch jobs and command procedures.

9.4.1. Command Procedures

Specify the SORT command in your command procedure just as you would write it on the screen. If your default directory does not contain the files to be sorted, explicitly set your default directory in the command procedure or include the directory in the command file specifications.

The following example submits the DCL command procedure SORTJOB.COM as a batch job. The text of the command procedure is shown following the command line:
$ SUBMIT SORTJOB

! SORTJOB.COM
!
$ SET DEFAULT [USER.PER]   ! Set default to location of input files
$ SORT/KEY=(POSITION:10,SIZE:15) EMPLOYEE.LST BYNAME.LST
$ TYPE BYNAME.LST
$ EXIT

9.4.2. Including Input Records

You can include the input records in the batch job by placing them after the SORT command with one record per line. Individual sort records can be longer than one line.

As with terminal input of records, specify the input file parameter as SYS$INPUT. Use the /FORMAT qualifier to specify the record size in bytes and the approximate file size in blocks. Approximately six 80-character lines equal one block.

The following example demonstrates including input records in a command procedure:
$ SUBMIT SORTJOB

! SORTJOB.COM
!
$ SET DEFAULT [USER.PER]
$ SORT/KEY=(POSITION:10,SIZE:15) -
SYS$INPUT-
/FORMAT=(RECORD_SIZE:24,FILE_SIZE:10) -
BYNAME.LST
$ DECK
BST 7828 MCMAHON JANE
ADM 7933 ROSENBERG HARRY
COM 8102 KNIGHT MARTHA
ANS 8042 BENTLEY PETER
BIO 7951 LOWELL FRANK
$ EOD

9.5. Merging Files

The MERGE command combines up to 10 (the high-performance Sort/Merge utility supports up to 12) sorted files into one ordered output file. You can merge input files that have the same format and have been sorted by the same key fields.

By default, Merge checks the sequence of the records in the input files to be sure they are in order. Specify the /NOCHECK_SEQUENCE qualifier if you do not want Merge to check the order. If you specify the /CHECK_SEQUENCE qualifier and a record is out of order (for example, if you have not sorted one of the input files), Merge reports the following error:
%SORT-W-BAD_ORDER, merge input is out of order
You can use the same qualifiers with the MERGE command as you use with the SORT command with two exceptions:
  • You cannot specify a process (/PROCESS) for a Merge operation.

  • The /CHECK_SEQUENCE qualifier is used only for a merge operation.

In the following example, the files BYNAME1.LST and BYNAME2.LST have already been sorted by employee name in ascending order. The command shown merges them:
$ MERGE BYNAME1.LST,BYNAME2.LST BYNAME3.LST

The output file BYNAME3.LST contains all the records from both files, BYNAME1.LST and BYNAME2.LST, as shown in the following figure:

9.5.1. Sorted Files

To merge files that are sorted using a specific key, you must specify the same key with the /KEY qualifier on the MERGE command line.

If you do not specify a key, Merge uses the default key described in Section 9.2, “Sorting Files”.

In the following example, the files BILLING1.LST and BILLING4.LST were sorted by account number (/KEY=POSITION:5,SIZE:4,DECIMAL). To merge the files into the output file MAILING.LST, enter the following command line:
$ MERGE/KEY=(POSITION:5,SIZE:4,DECIMAL) -
_$ BILLING1.LST,BILLING4.LST MAILING.LST

The results of the merge are as follows:

If you want to merge files that you know are in sorted order, you can prevent sequence checking by specifying the /NOCHECK_SEQUENCE qualifier.

9.5.2. Identical Key Fields

As with a Sort operation, when input files contain records with identical key fields, Merge does not necessarily maintain the same order in which the records had appeared in the input file. To maintain the input order of records with identical keys, specify the /STABLE qualifier on the MERGE command line. To retain only one copy of records with identical keys, specify the /NODUPLICATES qualifier.

9.6. Entering Records from a Terminal

Records that you want to sort or merge do not have to be in a file. You can enter the records directly from the terminal as you enter the SORT or MERGE command. The following table describes the procedure:

Step

Task

1

Specify SYS$INPUT as the input file on the SORT or MERGE command line.

Use the input file qualifier /FORMAT to specify the size of the longest record, in bytes, and the approximate size of the input file, in blocks.

2

Enter the input records on successive lines.

End each record by pressing Return.

3

Press Ctrl/Z to end the file.

The following example demonstrates a Sort operation in which the input records to be sorted are entered directly from the terminal:
$ SORT/KEY=(POSITION:8,SIZE:15) -
_$ SYS$INPUT/FORMAT=(RECORD_SIZE:24,FILE_SIZE:10) BYNAME.LST
BST 7828 MCMAHON JANE
ADM 7933 ROSENBERG HARRY
COM 8102 KNIGHT MARTHA
ANS 8042 BENTLEY PETER
BIO 7951 LOWELL FRANK

This sequence of commands creates the output file BYNAME.LST, which contains the sorted records.

9.7. Using a Sort/Merge Specification File

Sort/Merge allows you to maintain sort definitions and to specify more complex sort criteria in specification files. The high-performance Sort/Merge utility does not support specification files. Implementation of this feature is deferred to a future OpenVMS release. You can use any standard editor, or the DCL CREATE command to create a specification file.

A Sort/Merge specification file allows you to:
  • Select records to be included in the Sort/Merge operation

  • Reformat the records in the output file

  • Use conditional keys or data

  • Specify multiple record formats

  • Create or modify a collating sequence

  • Reassign work files

  • Store frequently used Sort/Merge operations

After you complete the specification file, specify the file name using the /SPECIFICATION qualifier. The default file type for a specification file is .SRT.

Each command in the specification file should start with a slash (/). Continuation characters are not required if a command spans more than one line.

Note

Many of the qualifiers used in the specification file are similar to the DCL qualifiers used in the Sort/Merge command line. Note, however, that the syntax of these qualifiers can be different. For example, the /KEY qualifier at DCL level has different syntax than the /KEY qualifier in the specification file. See Section 9.9.3, “Specification File Qualifiers” for a summary of the specification file qualifiers.

Any DCL command qualifiers that you specify on the command line override corresponding entries in the specification file. For example, if you specify the /KEY qualifier in the DCL command line, Sort/Merge ignores the /KEY clause in the specification file.

Generally, there is no required order in which you must specify the qualifiers in a specification file. However, the order becomes significant in the following cases:
  • Sorting by more than one key field if you do not specify the NUMBER:n key element

  • Describing the output format

  • Defining multiple record types

When you specify the FOLD, MODIFICATION, and IGNORE keywords with the /COLLATING_SEQUENCE qualifier, you should specify all MODIFICATION and IGNORE clauses before any FOLD clauses. See Section 9.9.3, “Specification File Qualifiers” for more information about the /COLLATING_SEQUENCE qualifier.

You can include comments in your specification file by beginning each comment line with an exclamation point (!). Unlike DCL command lines, specification files do not need hyphens (-) to continue the line.

Examples

  1. This is an example of a specification file that can be used to sort negative and positive data in ascending order:
    ! Specification file for sorting negative and positive data
    ! in ascending order
    ! /FIELD=(NAME=SIGN,POS:1,SIZ:1) 1
    /FIELD=(NAME=AMT,POS:2,SIZ:4) 2
    /CONDITION=(NAME=CHECK1, 3 TEST=(SIGN EQ "-"))
    /CONDITION=(NAME=CHECK2, 4 TEST=(SIGN EQ " "))
    /INCLUDE=(CONDITION=CHECK1, 5 KEY=(AMT,DESCENDING), DATA=SIGN, DATA=AMT)
    /INCLUDE=(CONDITION=CHECK2, 6 KEY=(AMT,ASCENDING), DATA=SIGN, DATA=AMT) 
    As you examine the specification file, note the following:

    1

    This command line defines a field that begins in byte 1 of the record and is 1 byte long. It assigns the field the name SIGN.

    2

    This command line defines a field that begins in byte 2 of the record and is 4 bytes long. It assigns the field the name AMT.

    3

    This is a condition statement. If there is a negative sign (−) in the SIGN byte, the CHECK1 condition is met.

    4

    This is a condition statement. If the SIGN byte is blank, the CHECK2 condition is met.

    5

    If the condition CHECK1 is met, then the record is sorted in descending order.

    6

    If the condition CHECK2 is met, then the record is sorted in ascending order.

    Figure 9.8, “Output from Using a Specification File” shows the result of using the specification file on an input file named BALANCES.LIS.

    Figure 9.8. Output from Using a Specification File
    Output from Using a Specification File
  2. /FIELD=(NAME=RECORD_TYPE,POS:1,SIZ:1)  ! Record type, 1-byte
    /FIELD=(NAME=PRICE,POS:2,SIZ:8)               ! Price, both files
    /FIELD=(NAME=TAXES,POS:10,SIZ:5)              ! Taxes, both files
    /FIELD=(NAME=STYLE_A,POS:15,SIZ:10)           ! Style, format A file
    /FIELD=(NAME=STYLE_B,POS:20,SIZ:10)           ! Style, format B file
    /FIELD=(NAME=ZIP_A,POS:25,SIZ:5)              ! Zip code, format A file
    /FIELD=(NAME=ZIP_B,POS:15,SIZ:5)              ! Zip code, format B file
    /CONDITION=(NAME=FORMAT_A,                    ! Condition test, format A
                TEST=(RECORD_TYPE EQ "A"))
    /CONDITION=(NAME=FORMAT_B,                    ! Condition test, format B
                TEST=(RECORD_TYPE EQ "B"))
    /INCLUDE=(CONDITION=FORMAT_A,                 ! Output format, type A
              KEY=ZIP_A,
              DATA=PRICE,
              DATA=TAXES,
              DATA=STYLE_A,
              DATA=ZIP_A)
    /INCLUDE=(CONDITION=FORMAT_B,                 ! Output format, type B
              KEY=ZIP_B,
              DATA=PRICE,
              DATA=TAXES,
              DATA=STYLE_B,
              DATA=ZIP_B)
    In this example, two input files from two different branches of a real estate agency are sorted according to the instructions specified in a specification file. The records in the first file that begin with an A in the first position have this format:
           |A|PRICE|TAXES|STYLE|ZIP|
            1 2     10    15    25
    The records in the second file that begin with a B in the first position and have the style and zip code fields reversed, are as follows:
           |B|PRICE|TAXES|ZIP|STYLE|
            1 2     10    15  20

    To sort these two files on the zip code field in the format of record A, first define the fields in both records with the /FIELD qualifiers. Then, specify a test to distinguish between the two types of records with the /CONDITION qualifiers. Finally, the /INCLUDE qualifiers change the record format of type B to record format of type A on output.

    Note that, if you specify either key or data fields in an /INCLUDE qualifier, you must explicitly specify all the key and data fields for the Sort operation in the /INCLUDE qualifier.

    Also note that records that are not type A or type B are omitted from the sort.

  3. /COLLATING_SEQUENCE=(SEQUENCE=
    ("AN","EB","AR","PR","AY","UN","UL",
    "UG","EP","CT","OV","EC","0"-"9"),
    MODIFICATION=("'"="19"),
    FOLD)
    This /COLLATING_SEQUENCE qualifier specifies a user-defined sequence that gives each month a unique value in chronological order. For example, if you want to order a file called SEMINAR.DAT according to the date, the file SEMINAR.DAT would be set up as follows:
           16 NOV 1983   Communication Skills
           05 APR 1984   Coping with Alcoholism
           11 Jan '84    How to Be Assertive
           12 OCT 1983   Improving Productivity
           15 MAR 1984   Living with Your Teenager
           08 FEB 1984   Single Parenting
           07 Dec '83    Stress — Causes and Cures
           14 SEP 1983   Time Management

    The primary key is the year field; the secondary key is the month field. Because the month field is not numeric and you want the months ordered chronologically, you must define your own collating sequence. You can do this by sorting on the second two letters of each month–in their chronological sequence–giving each month a unique key value.

    The MODIFICATION option specifies that the apostrophe (') be equated to 19, thereby allowing a comparison of '83 and 1984. The FOLD option specifies that uppercase and lowercase letters are treated as equal.

    The output from this Sort operation appears as follows:
           14 SEP 1983   Time Management
           12 OCT 1983   Improving Productivity
           16 NOV 1983   Communication Skills
           07 Dec '83    Stress — Causes and Cures
           11 Jan '84    How to Be Assertive
           08 FEB 1984   Single Parenting
           15 MAR 1984   Living with Your Teenager
           05 APR 1984   Coping with Alcoholism

    See Section 9.3, “Specifying a Collating Sequence” for other examples of creating user-defined collating sequences.

  4. /FIELD=(NAME=AGENT,POSITION:20,SIZE:15)
    /CONDITION=(NAME=AGENCY,
                TEST=(AGENT EQ "Real-T Trust"
                OR
                AGENT EQ "Realty Trust"))
    /DATA=(IF AGENCY THEN "Realty Trust" ELSE AGENT)

    In this example, two real estate files are being sorted. One file refers to an agency as Real-T Trust; the other refers to the same agency as Realty Trust. The /CONDITION and /DATA qualifiers instruct Sort to list the AGENT field in the sorted output file as Realty Trust.

  5. /FIELD=(NAME=ZIP,POSITION:60,SIZE:6)
    /CONDITION=(NAME=LOCATION,
                TEST=(ZIP EQ "01863"))
    /KEY=(IF LOCATION THEN 1
          ELSE 2)

    In this example, all the records with a zip code of 01863 will appear at the beginning of the sorted output file. The conditional test is on the ZIP field, defined with the /FIELD qualifier; the condition is named LOCATION. The values 1 and 2 in this /KEY qualifier signify a relative order for those records that satisfy the condition and those that do not.

  6. /FIELD=(NAME=ZIP,POSITION:60,SIZE:6)
    /CONDITION=(NAME=LOCATION,
                TEST=(ZIP EQ "01863"))
    /DATA=(IF LOCATION THEN "NORTH CHELMSFORD"
           ELSE "Outside district")

    In this example, the /CONDITION qualifier tests for the 01863 zip code. The /DATA qualifier specifies that the name of town field will be added to the output record, depending on the test results.

  7. /FIELD=(NAME=FFLOAT,POS:1,SIZ:0,F_FLOATING)
    /CONDITION=(NAME=CFFLOAT,TEST=(FFLOAT GE 100))
    /OMIT=(CONDITION=CFFLOAT)

    In this example, the number 100 is considered to be an F_FLOATING data type because field FFLOAT is defined as F_FLOATING in the /FIELD qualifier.

  8. /FIELD=(NAME=AGENT,POSITION:1,SIZE:5)
    /FIELD=(NAME=ZIP,POSITION:6,SIZE:3)
    /FIELD=(NAME=STYLE,POSITION:10,SIZE:5)
    /FIELD=(NAME=CONDITION,POSITION:16,SIZE:9)
    /FIELD=(NAME=PRICE,POSITION:26,SIZE:5)
    /FIELD=(NAME=TAXES,POSITION:32,SIZE:5)
    /DATA=PRICE
    /DATA="  "
    /DATA=TAXES
    /DATA="  "
    /DATA=STYLE
    /DATA="  "
    /DATA=ZIP
    /DATA="  "
    /DATA=AGENT
    The /FIELD qualifiers define the fields in the records from an input file that has the following format:
    AGENT ZIP STYLE CONDITION PRICE TAXES
    The /DATA qualifiers, which use the field-names defined in the /FIELD qualifiers, reformat the records to create output records of the following format:
    PRICE TAXES STYLE ZIP AGENT

9.8. Optimizing a Sort or Merge Operation

There are several ways in which you can improve the efficiency of a Sort or Merge operation, based on your sorting environment. Use the /STATISTICS qualifier with the SORT or MERGE command to get information about the variables in your sorting environment.

After you examine the statistics display, consider any of the optimization options presented in the following sections.

When you enter the SORT or MERGE command with the /STATISTICS qualifier, you see output similar to the following:
$ SORT/STATISTICS PAGEANT.LIS DOCUMENT.LIS

                  OpenVMS Sort/Merge Statistics

Records read:           3 1     Input record length:       26
Records sorted:         3        Internal length:           28
Records output:         3        Output record length:      26
Working set extent: 16384 2     Sort tree size:            42
Virtual memory:       392        Number of initial runs:     0
Direct I/O:            10        Maximum merge order:        0
Buffered I/O:          11        Number of merge passes:     0
Page faults:          158 3     Work file allocation:       0 4
Elapsed time: 00:00:00.54        Elapsed CPU:      00:00:00.03 5
As you examine the fields, note the following:

1

Records read

Lists the number of records that were read during a Sort operation. See Section 9.8.2, “Omitting Records and Fields” for information on selectively omitting records from a Sort operation.

2

Working set extent

Shows how many blocks are reserved to perform the sort operation. See Section 9.8.4, “Modifying the Working Set Extent” for information on making your working set larger.

3

Page faults

Shows how many times the operating system has transferred parts of your process from physical memory to your paging device. See Section 9.8.4, “Modifying the Working Set Extent” for more information on preventing paging.

4

Work file allocation

Shows how much disk space is reserved for your work file. See Section 9.8.3, “Assigning Work Files” for more information on work files.

5

Elapsed CPU

Shows how much CPU time the operating system took to process the sort operation. See Section 9.8.1, “Sorting Process” for information on saving time by choosing different methods of sorting.

9.8.1. Sorting Process

Sort defines four processes for sorting data internally: record, tag, address and indexed. The high-performance Sort/Merge utility supports only the record process. Implementation of tag, address, and index processes is deferred to a future OpenVMS release. RECORD is the default process. The type of process you choose affects the performance of the Sort operation as well as storage requirements. See Section 9.2.6, “Sorting Process” for information about the different sort processes.

Before you select a sorting process, consider the following:
  • How you will use the output file
    • Because record and tag sorting generate files that contain entire sorted records, these reordered files are ready to be used.

    • Both address- and index-sorted output files can be processed by a program written in a programming language such as Pascal, Fortran, MACRO, or C.

    • Address sorting creates an output file of pointers to the records in the input file. This list consists of binary RFAs plus a file number when sorting multiple input files. A program accesses the records by using the pointers.

    • Index sorting creates an output file containing both RFAs and key fields plus a file number when sorting multiple files. The format of these key fields is the same as in the input files. If the program needs the key field contents for a decision during future processing, select index sorting rather than address sorting.

    If you need to reorder records from one file in several ways for different purposes, store several output files from address or index sorting. Use the output files to access the records in the main file in the sorted order that you want.

  • The temporary storage space available for sorting

    Tag sorting uses less temporary storage space than record sorting. Because record sorting keeps the record intact during the sort, it uses much more work space when the files are large. Address and index sorting use little temporary storage space.

  • The type of input and output device used

    Record sorting is the only process that can accept input from cards, magnetic tape, and disks. Output from tag and record sorting can go to any output device. Output from address and index sorting must go to a device that accepts binary data.

  • The differences in speed

    If you plan to retrieve the sorted records at some point in the operation, record sorting is usually the fastest process. Otherwise, address and index sorting are the fastest processes.

9.8.2. Omitting Records and Fields

From a specification file, you can improve Sort efficiency by using the /CONDITION, /INCLUDE, and /OMIT qualifiers to process only those records needed in the output file. The high-performance Sort/Merge utility does not support specification files. Implementation of this feature is deferred to a future OpenVMS release. You can also use specification file qualifiers to reformat records, omitting unnecessary fields from the output file. These qualifiers are not available as command line qualifiers.

9.8.3. Assigning Work Files

During a Sort operation, records from the input file are read into memory. If the allocated memory cannot hold all the records, Sort transfers the sorted data to one or more temporary work files. Merge does not use work files.

You can increase sort efficiency by changing the number of work files and by assigning them to specific devices:
  • The Sort command line qualifier /WORK_FILES=n overrides the number of work files allocated.

  • Normally, Sort places work files on the device SYS$SCRATCH and accesses them in an arbitrary order. You can assign work files to specific devices in two ways:
    • In a specification file, the /WORK_FILES=(device,...) qualifier places the work files on the specified devices. See Section 9.9.3, “Specification File Qualifiers” for more information about using the /WORK_FILES qualifier in a specification file.

    • If you are not using a specification file, you can use the DCL command ASSIGN to assign the work files to specific devices.

      Sort uses the SORTWORKn logical names to identify user-specified device names for the workfiles, where n is a value from 0 through 9. For the high-performance Sort/Merge utility, n is a value from 0 to 254. Define a SORTWORKn logical as follows:
      ASSIGN device: SORTWORKn
      For example,
      $ ASSIGN WORK$2: SORTWORK1
      $ ASSIGN WORK$3: SORTWORK2

      This example defines SORTWORK1 as the device WORK$2: and SORTWORK2 as the device WORK$3:. For more information on logical names, see Chapter 11, Defining Logical Names for Devices and Files.

Consider the following when you assign work files to devices:
  • Assign work files to the fastest devices available. For example, random-access, mass storage devices such as disks.

  • Choose devices with the least activity and the most space available.

  • Assign each work file to a different physical device to maximize overlapping input and output.

9.8.4. Modifying the Working Set Extent

If Sort requires work files (for example, if you are sorting a large file), a larger working set can increase sort efficiency. However, if your system is used heavily, it might be unable to allocate all the pages in the working set extent to your process. This can result in paging, which occurs when the operating system transfers parts of a process between physical memory and memory on a paging device; only the active part of the process remains in the physical memory. To avoid excessive paging, you can decrease the working set extent for your process. Use the SET WORKING_SET command to decrease the working set extent.

9.9. Summary of Sort/Merge Qualifiers

The following list describes command qualifiers used with the SORT and MERGE commands. To use a command qualifier, include the qualifier immediately after the SORT or MERGE command.

/[NO]CHECK_SEQUENCE

Applies to the MERGE command only. Verifies the sequence of the records in MERGE input files. Merge checks the sequence of records by default.

The /CHECK_SEQUENCE qualifier checks whether the records of one or more files (up to 10; the high-performance Sort/Merge utility supports up to 12) have been sorted. The records will still be directed to an output file, which you must specify. If you are checking whether records are sorted on a key field other than the entire record, you must specify key information, along with the requesting sequence.

Use the /NOCHECK_SEQUENCE qualifier to prevent Merge from checking the sequence of records.

Example
$ MERGE/KEY=(SIZE:4,POSITION:3)/NOCHECK_SEQUENCE -
_$ PRICE1.DAT,PRICE2.DAT PRICE.LIS

In this example, the /NOCHECK_SEQUENCE qualifier specifies that the sequence of the input files, PRICE1.DAT and PRICE2.DAT, is not to be checked.

/COLLATING_SEQUENCE=sequence

Selects one of three predefined collating orders for character key fields, or specifies the name of a National Character Set (NCS) collating sequence to be used in comparing character keys. The high-performance Sort/Merge utility does not support the NCS collating sequences. Support for NCS collating sequences is deferred to a future OpenVMS release. Sort can arrange characters in ASCII (default), EBCDIC, or Multinational sequences.

Example
$ SORT/COLLATING_SEQUENCE=MULTINATIONAL -
_$ NAMES.DAT,NOM.DAT LIST.LIS

This SORT command arranges the input files NAMES.DAT and NOM.DAT according to the Multinational collating sequence to create the output file LIST.LIS.

/[NO]DUPLICATES

By default, Sort retains all multiple records with duplicate keys. The /NODUPLICATES qualifier eliminates all but one of multiple records with duplicate keys. The retained records may not appear in the same order as they appeared in the input file. If you want to specify which duplicate record to keep, invoke Sort at the program level and specify an equal-key routine.

The /STABLE and the /NODUPLICATES qualifiers are mutually exclusive.

Example
$ SORT/KEY=(POSITION:3,SIZE:5,DECIMAL)/NODUPLICATES -
_$ ACCT1,ACCT2 ACCT.LIS

This SORT command arranges the two input files according to the key supplied and eliminates all but one of multiple records with equal keys.

/KEY=(POSITION:n,SIZE:n[,field,...])

Describes key fields, including the position, size, sorting order (ASCENDING or DESCENDING), priority (NUMBER:n), and data type (such as character, binary, h_floating). By default, Sort reorders a file by sorting entire records with character data in ascending order.

See Section 9.2.1, “Defining a Key” for detailed information about the /KEY qualifier.

/PROCESS=type

Applies to the SORT command only. Defines the internal sorting process. The /PROCESS qualifier allows you to choose one of four processes: record, tag, address, or index. The high-performance Sort/Merge utility supports only the record process. Implementation of tag, address, and index processes is deferred to a future OpenVMS release.

See Section 9.2.6, “Sorting Process” for detailed information about the /PROCESS qualifier.

Example
$ SORT/KEY=(POS:40,SIZ:2,DESC)/PROCESS=TAG YRENDAVG.DAT -
_$ DESCYRAVG.LIS

This Sort operation uses a tag sorting process to create the output file DESCYRAVG.LIS.

/SPECIFICATION=filespec

The high-performance Sort/Merge utility does not support this qualifier. Implementation of this feature is deferred to a future OpenVMS release.

Identifies a Sort or Merge specification file to be used in a Sort or Merge operation. The default specification file type is .SRT.

See Section 9.7, “Using a Sort/Merge Specification File” and Section 9.9.3, “Specification File Qualifiers” for information about using specification files.

/[NO]STABLE

By default, records with equal keys are not guaranteed to be placed in the output file in the order they appear in the input file. The /STABLE qualifier maintains the records in that order.

The /STABLE and /NODUPLICATES qualifiers are mutually exclusive.

Example
$ SORT/KEY=(POS:1,SIZ:5,DECIMAL)/STABLE PRICESA.DAT, -
_$ PRICESB.DAT,PRICESC.DAT SUMMARY.LIS

In this Sort operation, records with equal keys from PRICESA.DAT will be listed first, followed by those from PRICESB.DAT, followed by those from PRICESC.DAT.

/[NO]STATISTICS

Displays a statistical summary to SYS$OUTPUT that can be used for optimization. To save these statistics in a file, use the following command:

$ DEFINE/USER SYS$ERROR output-file
The statistical summary contains the following information:

Statistic

Description

Records read

The number of records read by Sort or Merge.

Records sorted

The number of records that have been processed using Sort. This number could be less than the number of records read if a specification file is used to select only certain records for the Sort or Merge operation.

Records output

The number of records written to the output file. This number could be less than the number of records sorted if /NODUPLICATES was selected or if I/O errors occurred when the output records were being written.

Working set extent

The number of pages in the process working set extent. This value is used as an upper limit on the size of the sort data structure. Adjusting this value is one way to improve the efficiency of a Sort operation.

Virtual memory

The number of pages of virtual memory added to the Sort image to hold the data.

Direct I/O + buffered I/O

This total is the number of I/O movements needed to read and write data. The lower this total value is, the more efficient the ordering operation.

Page faults

Indicates how well the data fits into memory: the higher the number of page faults, the less efficient the ordering operation.

Elapsed time

The total wall clock time used by the Sort or Merge operation in hours, minutes, seconds, and hundredths of seconds.

Input record length

This value is obtained from the Record Management Services (OpenVMS RMS) unless the user supplies it.

Internal length

The size in bytes of an internal format node. This includes any keys, data, a word to store the length, record file addresses (RFAs), and converted keys.

Output record length

The length of the output record. The length is computed from the input record length, the sort process, and the record reformatting requested.

Sort tree size

The number of records that fit in the Sort internal data structure.

Number of initial runs

One indication of how well the data fits into memory.

Maximum merge order

The maximum number of sorted strings that are merged at one time.

Number of merge passes

The number of times the Sort utility merges strings until one sorted output string is produced. The number of initial runs and the number of merge passes indicate how well the data fits into memory. The higher these numbers, the further the working set size is from containing the data and the longer the sorting takes.

Work file allocation

The number of blocks used for the work files. When more than one merge pass is needed, this size is approximately twice the size of the input file allocation.

Elapsed CPU

The CPU time used by the ordering operation; it does not include time spent waiting for I/O operations to complete or time spent waiting while another process executes.

Example
$ SORT/STATISTICS PRICE1.DAT,PRICE2.DAT PRICE.LIS
This SORT /STATISTICS command results in the following statistical display:
              OpenVMS Sort/Merge Statistics

Records read:         793   Input record length:     80
Records sorted:       793   Internal length:         80
Records output:       793   Output record length:    80
Working set extent:   100   Sort tree size:         412
Virtual memory:       433   Number of initial runs:   2
Direct I/O:            22   Maximum merge order:      2
Buffered I/O:           9   Number of merge passes:   1
Page faults:         3418   Work file allocation:   114
Elapsed time: 00:00:05.98   Elapsed CPU:    00:00:03.63
/WORK_FILES[=n]

Applies to the SORT command only. Increases the number of Sort work files by any number, from 1 to 10 (the high-performance Sort/Merge utility supports up to 255) inclusively, to make each work file smaller. If the available disks are too small or too full for work files, increasing the number of files can improve the efficiency of the Sort operation.

Sort does not create work files until it needs them. If Sort needs work files, it creates two by default (SORTWORK0, SORTWORK1), which are placed in the SYS$SCRATCH directory.

Example
$ ASSIGN DRA5: SORTWORK0
$ ASSIGN DB0: SORTWORK1
$ ASSIGN DB1: SORTWORK2
$ SORT/KEY=(POS:1,SIZ:80)/WORK_FILES=3 -
_$ STATS1,STATS2,STATS3,STATS4 SUMMARY.LIS

Because the input files in this Sort operation are large files, specifying three work files improves the efficiency of the sort operation.

Note that you can also assign the work files to a specific directory on a device by including the directory name. For example, to assign SORTWORK0 to the [WORKSPACE] directory on DRA5, enter the following command:
$ ASSIGN DRA5:[WORKSPACE] SORTWORK0

9.9.1. Input File Qualifier

The following input qualifier should be included immediately after the input file specification in the SORT or MERGE command line:

/FORMAT=(RECORD_SIZE:n,FILE_SIZE:n)

Defines input file characteristics; allows you to specify or override record or file size. It must be specified immediately after the input file specification in the Sort or Merge command line.

Sort uses input file size information to determine the amount of memory needed, as well as the size of the work files for the Sort operation. If the file size is unknown (for example, you are sorting files that do not reside on disk or standard ANSI magnetic tape), Sort assumes a fairly large file size.

Specify the following qualifier values:

RECORD_SIZE:n

Specifies the input file's longest record length (LRL) in bytes. The maximum longest record length that can be specified depends on the file organization:

Sequential32,767
Relative16,383
Indexed-sequential16,362

These values include control bytes for variable records with fixed-length control (VFC) format.

FILE_SIZE:n

Specifies input file size in blocks. The maximum file size accepted is 4,294,967,295 blocks.

You can also use /FORMAT as an output file qualifier. See Section 9.9.2, “Output File Qualifiers” for more information.

Example
$ SORT/KEY=(POS:40,SIZ:2,DESC) -
_$CRA0:YRENDAVG.DAT/FORMAT=(RECORD_SIZE:41,FILE_SIZE:3) -
_$DESCYRAVG.LIS

Because the input file YRENDAVG.DAT does not reside on a disk device or ANSI magnetic tape, file organization must be described by the /FORMAT qualifier.

9.9.2. Output File Qualifiers

The following output qualifiers can be used with the SORT and MERGE commands. To use an output file qualifier, include the qualifier immediately after the output file specification in the SORT or MERGE command line.

/ALLOCATION=n

Specifies the number of blocks, from 1 through 4,294,967,295, to be preallocated to the output file for optimization. Use this qualifier when you know that the output file allocation will differ substantially from the total input file allocation (for example, when reformatting data or omitting records).

The /ALLOCATION qualifier is required if the /CONTIGUOUS qualifier is used.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT -
_$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS

This SORT command allocates 1000 contiguous blocks for the output file SUMMARY.LIS.

/BUCKET_SIZE=n

Specifies OpenVMS RMS bucket size (the number of 512-byte blocks per bucket) to be used by relative and indexed sequential output disk files for optimization. A value of 1 through 32 is allowed.

If the output file organization is the same as for the input files, the default value is the same as the bucket size of the first input file. If output file organization is different, the default value is 1.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS1.DAT,STATS2.DAT -
_$ SUMMARY.LIS/BUCKET_SIZE=16/RELATIVE

This SORT command results in the output file SUMMARY.LIS that has a bucket size of 16 with relative organization.

/CONTIGUOUS

Requests that the output file be stored in contiguous disk blocks to decrease access time. Must be used with the /ALLOCATION qualifier. By default, Sort/Merge does not allocate contiguous disk blocks for the output file.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT -
_$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS

This SORT command allocates 1,000 contiguous blocks for the output file SUMMARY.LIS.

/FORMAT=(type:n[,...])

Specifies the output file record format (FIXED:n, VARIABLE:n, or CONTROLLED:n) if it differs from the input file format. You can also specify the size (SIZE:n) or the block size (BLOCK_SIZE:n) of the file records.

If the Sort operation is a record or tag sort, the default output record format is the same as the first input file record format. If the Sort operation is an address or index sort, the default output record format is fixed record format. If the input files have different record formats, Sort provides an output record size that is large enough to contain the largest record in the input files.

You can specify the following qualifier values.

BLOCK_SIZE:n

Specifies the output file's block size, in bytes, if you have directed the file to magnetic tape. If the input file is a tape file, the block size of the output file defaults to that of the input file. Otherwise, the output file block size defaults to the size used when the tape was mounted.

Acceptable values for n range from 20 to 65,532. To ensure correct data interchange with other VSI systems, however, specify a block size of not more than 512 bytes. For compatibility with systems that are not made by VSI, the block size should not exceed 2,048 bytes.

CONTROLLED:n

Specifies variable with fixed-length control (VFC) records in the output file.

FIXED:n

Specifies fixed-length records in the output file.

SIZE:n

Specifies the size, in bytes, of the fixed portion of VFC (CONTROLLED) records, up to a maximum of 255 bytes. If you do not specify SIZE, the default is the size of the fixed portion of the first input file. If you specify this size as 0, OpenVMS RMS defaults the value to 2 bytes.

VARIABLE:n

Specifies variable-length records in the output file.

For any qualifier value, you can optionally specify n as the maximum record size (in bytes) of the output records. The maximum record size allowed depends on the file organization:

Sequential files

32,767

Relative files

16,383

Indexed-sequential files

16,362

These maximum record size values include control bytes for variable records with fixed-length control (VFC) format.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/FORMAT=FIXED:80

The input file STATS.DAT consists of variable-length records that are 80 bytes in length. The /FORMAT qualifier specifies that the output file, SUMMARY.LIS, consists of fixed-length records.

/INDEXED_SEQUENTIAL

Defines the file organization for the output file as indexed sequential. Note that the output file must already exist and must be empty. In addition, you must specify that the empty file is to be overlaid with the sorted records by using the /OVERLAY qualifier.

Example
$ CREATE/FDL=NEW.FDL AVERAGE.DAT
$ SORT/KEY=(POS:1,SIZ:80) DATA.DAT,STATS.DAT -
_$ AVERAGE.DAT/INDEXED_SEQUENTIAL/OVERLAY

The CREATE/FDL command creates the empty file AVERAGE.DAT. The SORT command specifies that the output file have an indexed-sequential organization and be written to the empty file AVERAGE.DAT.

/OVERLAY

Specifies an existing empty file that the output file is to be overlaid on, or written to. The /OVERLAY qualifier is required when you use the /INDEXED_SEQUENTIAL qualifier.

If the input file organization is indexed-sequential, the output file must already exist and be empty. If the output file is not empty, /OVERLAY does not write over the file. Instead, it appends the result of the sort to the existing output file.

You can use the CREATE/FDL utility to create an empty data file. Any attributes that you specify when creating the empty file then become attributes of the Sort output file.

Example
$ CREATE/FDL=NEW.FDL AVERAGE.DAT
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT AVERAGE.DAT/OVERLAY

The FDL file NEW.FDL specifies special attributes for the file AVERAGE.DAT. When Sort writes output to that file, the resulting Sort output file has the attributes specified by the FDL file.

/RELATIVE

Defines the file organization for the output file as relative.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/RELATIVE

Because the input file STATS.DAT is not a relative file and the output file SUMMARY.LIS will be, /RELATIVE qualifies the output file specification.

/SEQUENTIAL

Defines the file organization for the output file as sequential. This is the default for address and index sorting operations. The default for record and tag sorting operations is the organization of the first input file.

Example
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/SEQUENTIAL

Because the input file STATS.DAT is not a sequential file and the output file SUMMARY.LIS will be, /SEQUENTIAL qualifies the output file specification.

9.9.3. Specification File Qualifiers

The following qualifiers can be used in specification files. The high-performance Sort/Merge utility does not support specification files. Implementation of this feature is deferred to a future OpenVMS release. Note that these qualifiers are valid only within a Sort/Merge specification file.

/CDD_PATH_NAME=cdd-path-name

Identifies fields and attributes defined for use with the Common Data Dictionary (CDD/Plus) using the CDD/Repository command. Once the fields have been identified, they can then be used later with other specification file qualifiers, such as /KEY, /CONDITION, /INCLUDE, or /OMIT.

/CDD_PATH_NAME can be used in place of or in conjunction with /FIELD statements.

The cdd-path-name value is the CDD/Plus record definition within CDD/Plus. You can use the /CDD_PATH_NAME qualifier only if your system has CDD/Plus installed.

Example
/CDD_PATH_NAME="employee"

The /CDD_PATH_NAME qualifier identifies the employee record, which had been defined previously in CDD/Plus.

/[NO]CHECK_SEQUENCE

Applies to the MERGE command only. Specifies whether or not the sequence of records in the input file is checked. By default, Merge checks the sequence of records.

Example
/NOCHECK_SEQUENCE

The /NOCHECK_SEQUENCE qualifier overrides the Merge utility's default behavior.

/COLLATING_SEQUENCE=(SEQUENCE=sequence-type [,MODIFICATION=(char1 operator char2)] [,IGNORE=character or character range,...] [,FOLD] [,[NO]TIE_BREAK])

Specifies one of three predefined collating sequences (ASCII, EBCDIC, or Multinational) or a user-defined sequence for character key fields. Allows you to modify any of the predefined collating sequences or any previously defined user-defined sequences.

See Section 9.3, “Specifying a Collating Sequence” for information about using the ASCII, EBCDIC, and Multinational collating sequences.

You can specify the following qualifier values:

SEQUENCE

Specification files support the ASCII, EBCDIC, multinational, and user-defined collating sequences. See Section 9.3, “Specifying a Collating Sequence” for information about these collating sequences.

MODIFICATION

Specifies a change to the collating sequence specified in the SEQUENCE option. You can modify the ASCII, EBCDIC, Multinational, or user-defined sequence. The sequence being modified must be specified with the SEQUENCE qualifier even if the sequence is the default (ASCII).

characterSpecifies a character in the collating sequence.
operatorSpecifies the operator used to compare the characters. You can specify greater than (>), less than (<), or equal to (=).

The following kinds of changes are permitted in the MODIFICATION option:

  • A single or double character can be equated to a single character that has already been assigned a collating value ("a"="A").

  • A single or double character can collate after a single character that has already been assigned a collating value ("CH">"C").

  • A single or double character can collate before a single character that has already been assigned a collating value ("D"<"A").

  • A double character can be equated to a previously defined double character ("CH" = "SH").

  • A single character can be equated to a double character sequence ("C" = "CH").

IGNORE

Specifies that Sort/Merge ignore a character or character range in the collating sequence when making an initial comparison. Note that, when tie-breaking takes place, Sort/Merge considers the characters specified with the IGNORE value.

FOLD

Specifies that all lowercase letters be given the collating value of their uppercase equivalents. For ASCII, EBCDIC, and user-defined sequences, the lowercase letters are a to z.

Because the lowercase letters in the Multinational sequence already have the collating value of their uppercase equivalents, using FOLD is unnecessary.

[NO]TIE_BREAK

Specifies whether or not Sort/Merge should use numeric values to break any ties between characters that have equivalent values. By default, tie-breaking occurs with the Multinational sequence. Specifying NOTIE_BREAK overrides this default and ensures that no further comparisons are made after the initial comparison.

A TIE_BREAK option must be specified for the ASCII, EBCDIC, and user-defined sequences in order for tie-breaking to occur. TIE_BREAK should be used when specifying the FOLD or MODIFICATION value for the these sequences.

Examples

See Section 9.3, “Specifying a Collating Sequence” and Section 9.7, “Using a Sort/Merge Specification File” for examples of the use of collating sequences in specification files.

/CONDITION=(NAME=condition-name, TEST=(field-name operator test-condition [logical-operator...]))

A specification file can be used to change the relative order of a record or to alter the contents of certain fields in a record. You must first use the /CONDITION qualifier to define a conditional test. Once you define a test using the /CONDITIONAL qualifier, you can use that same test with the /KEY or /DATA qualifier to change the order of record. You can also use the test with the /OMIT or /INCLUDE qualifier to change the contents of a record.

If you want to change the order of records in the output file, first specify a condition name with the /CONDITION qualifier and set up a test for what meets that condition. Then, specify the relative order with the /KEY qualifier of the form:
/KEY=(IF condition-name THEN value ELSE value)

You can use any values to specify the relative order of the records.

The /CONDITION qualifier also permits you to change the contents of a field in the output records. First specify a condition name, and then set up a test for what meets the condition. Specify the contents you want in the field in a /DATA qualifier of the form:
/DATA=(IF condition-name THEN "new-contents"
       ELSE "new-contents")
You can specify the following qualifier values:

NAME

Specifies the name of the condition that you are testing. This condition-name can be used in /KEY, /DATA, /OMIT, and /INCLUDE qualifiers after it has been defined using the /CONDITION qualifier.

TEST

Specifies the conditional test.

field-name

Specifies the name of the field you are testing. The field-name must be defined previously by the /FIELD qualifier.

operator
Specifies the logical or relational operator used in the conditional test. The logical operators that you can use are AND and OR. The relational operators that you can specify are as follows:
  • EQ = Equal to
  • NE = Not equal to
  • GT = Greater than
  • GE = Greater than or equal to
  • LT = Less than
  • LE = Less than or equal to
test-condition
Specifies the constant or field-name against which you are testing. A constant is specified with the following format:
  • Decimal_digits (default)
  • %Ddecimal_digits
  • %Ooctal_digits
  • %Xhexadecimal_digits
  • "character"

Normally, you do not need to specify the radix operator (%D); however, test-condition will assume the same data type as the field-name.

Examples

See Section 9.7, “Using a Sort/Merge Specification File” for examples of the use of the /CONDITION qualifier in specification files.

/DATA=field-name /DATA=(IF condition THEN new contents ELSE new contents)

Use the /DATA qualifier to eliminate or reorder fields from the output record. Specify the data fields in the order you want them to appear in the output record. A /DATA qualifier must identify every field in the records you are directing to the output file. Only those fields identified by the /DATA qualifier are to be directed to the output file.

You can conditionally change the contents of a field in the output records by first specifying a condition name and then setting up a test for what meets the condition in a /CONDITION qualifier. You then specify the contents you want in the field in a /DATA qualifier of the form:
/DATA=(IF condition-name THEN "new-contents" ELSE "new-contents")
You can specify the following qualifier values:

field-name

Specifies the name of a field in a record. The field-name must be defined previously in a /FIELD qualifier.

condition-name

Specifies a condition-name that has been defined previously in a /CONDITION qualifier.

new-contents

Specifies how the record is to be altered. The new-contents can be a constant or a field-name that has been defined in a /FIELD qualifier.

Examples

See Section 9.7, “Using a Sort/Merge Specification File” for examples of the use of the /DATA qualifier in specification files.

/FIELD=(NAME=field-name,POSITION:n,SIZE:N, [DIGITS:n,]data-type) /FIELD=(NAME=field-name,VALUE:n,SIZE:N,[DIGITS:n,] data-type)

Defines the fields in the input files when you are altering the order or format of output records. These fields include key fields, fields to be compared, and fields to be directed to the output file. You identify each field by specifying a name, its position and size in the record, and its data type.

Field names must be unique; no duplicate field names are allowed. In addition, you cannot use more than 255 field definitions.

You can also use /FIELD to define a constant and assign it a value of any valid Sort/Merge data type for use in /CONDITION, /DATA, and /KEY statements.

You can specify the following qualifier values:

NAME

Specifies the name of the field. The field-name cannot have any embedded spaces, must begin with an alphabetic character, and can be no longer than 31 characters.

POSITION:n

Specifies the position of the field in the record.

VALUE:n

Assigns a value to a constant field for use in a /CONDITION, /DATA, or /KEY statement. If you specify VALUE:n, do not specify /POSITION:n because the field is a constant and not part of an input record.

SIZE:n

Specifies the size of a field containing character or binary data. In the specification file, SIZE implies byte lengths. The data type determines what values are acceptable, as follows:

  • For character data, the size must not exceed 32,767 characters.

  • For binary data, the size specified must be 1, 2, 4, 8, or 16 bytes.

  • For floating-point data, no size is specified.

DIGITS:n

Specifies the size of a field containing decimal data. The size of a field containing decimal data must not exceed 31 digits. Note that DIGITS:n is used only when describing a field containing decimal data.

data-type

Specifies the data type of the field. You are not required to specify the data-type if it is character; Sort assumes character data type by default. See Section 9.2.1, “Defining a Key” for a list of the data types recognized by Sort/Merge.

Example
/FIELD=(NAME=SALARY,POSITION:10,DIGITS:8,DECIMAL)

This /FIELD qualifier identifies a field in a record by the name SALARY, specifies that it starts in position 10 of the record, is 8 digits long, and consists of decimal data.

/INCLUDE=(CONDITION=condition[,KEY=...] [,DATA=...])

You can specify that records are to be conditionally included in an output file. After defining a condition in a /CONDITION qualifier, specify record selection in an /INCLUDE qualifier requesting that records satisfying the condition are to be included in the output file.

You can specify multiple /INCLUDE and /OMIT qualifiers in a specification file. The order in which you specify them determines the order the input records are tested for inclusion. After the last /INCLUDE qualifier, all records that have not already been included or explicitly omitted are omitted.

You can unconditionally include any records not previously omitted or included by specifying the /INCLUDE qualifier without a condition.

When sorting multiple record formats, one /INCLUDE qualifier should be specified for each different record format among the records to be sorted. If you do not specify a KEY option within the INCLUDE qualifier, Sort assumes the default key definitions. If the KEY is specified in the /INCLUDE qualifier, the default key definitions are not used. The order of the KEY fields in the /INCLUDE qualifier determines how the internal key is built for sorting. The order of the DATA fields in the /INCLUDE qualifier determines the way the output record is formatted. If you specify a key or data field in an /INCLUDE qualifier, you must define all other key or data fields in the record.

You can specify the following qualifier values:

CONDITION

Refers to the condition-name specified in a previous /CONDITION qualifier.

KEY

Defines a key field because the default record type defined in the /KEY qualifier is not being used.

DATA

Defines a data field because the default record type defined in the /DATA qualifier is not being used.

Example
/FIELD=(NAME=ZIP,POSITION:20,SIZE:6)
/CONDITION=(NAME=LOCATION,
            TEST=(ZIP EQ "01863"))
/INCLUDE=(CONDITION=LOCATION)

These /CONDITION and /INCLUDE qualifiers specify that records with the zip code 01863 will be included in the output file.

/KEY=field-name /KEY=(field-name,order) /KEY=([IF condition THEN value ELSE]...) value [,order]

Specify the key fields to be used in the Sort operation. If you are sorting the entire record using character data, there is no need to specify your key field. Otherwise, specify a /KEY qualifier for each of the keys, in the order of their priority. You can sort on as many as 255 key fields.

There are three ways to use the /KEY qualifier:
  • To identify the key field name.

  • To identify the key field name and to specify sorting order. In this case, enclose the field name and the order option in parentheses.

  • As a conditional qualifier, to change the order of records in the output file. First, specify a condition-name in a /CONDITION qualifier, and set up a test for what meets that condition. Then, specify the relative order in a /KEY qualifier of the form:
    /KEY=(IF condition-name THEN value ELSE value)

    You can use any values to specify the relative order of the records.

You can specify the following qualifier values:

field-name

Specifies the name of the key field. The field-name has been previously specified in a