Document revision date: 30 March 2001

## OpenVMS Guide to Extended File Specifications

Previous | Contents | Index

## 3.3 Working in Mixed Environments

When working in an environment that contains both OpenVMS Alpha and OpenVMS VAX systems, it is important for a user to know the following:

- The system type
- The volume type where the user's default directory resides
- The volume type where the user creates a new file

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.

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.

## 3.4 DCL Support for ODS-5 Volumes

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. The default setting is TRADITIONAL. To set the parsing style, enter the command:

    $ SET PROCESS/PARSE_STYLE=EXTENDED

Note DCL lexical functions use the DEC Multinational character set, which is different from the ISO Latin-1 character set used for file names on an ODS-5 disk. This can lead to unexpected results if, for example, you use the DCL function F$EDIT to upcase a filename. F$EDIT will not upcase DEC MCS characters with hexadecimal values of F0, F7, FE, and FF.

See Section 3.4.1 for more information about changing the DCL name parsing style.

### 3.4.1 Using the Extended File Specifications Parsing Feature in DCL

Sections 3.4.1.1, 3.4.1.2, and 3.4.1.3 describe how to control the DCL name parsing style, both on the command line and in a command procedure.

#### 3.4.1.1 Enabling the Extended File Name Parsing Style

On OpenVMS Alpha systems, you can tell DCL to accept ODS-5 file names on a per process basis by entering the following 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

The circumflex (^) character is used as an escape character to tell DCL to treat the next character (in this case, a left bracket) as a literal character in the name, rather than as a delimiter.

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

#### 3.4.1.2 Resetting the Default File Name Parsing Style

The default DCL parsing style for file names is for ODS-2 style file names. 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.

#### 3.4.1.3 Switching Between File Name Parsing Styles

A command procedure that requires a specific file name parsing style can include commands within the procedure to switch between styles. The following command procedure saves the current parsing style, sets the parsing style to TRADITIONAL, performs (unspecified) commands, then restores the saved parsing style.

    $ original_style= f$getjpi("","parse_style_perm")
    $ SET PROCESS/PARSE_STYLE=TRADITIONAL
       .
       .
       .
    $ SET PROCESS/PARSE_STYLE='original_style'

The first command equates 'original_style' with the current parse style. The second command sets the parsing style to TRADITIONAL. The last command resets the parsing style to the original style.

### 3.4.2 Using Extended File Names in DCL Command Parameters

Command procedures that use file names as parameters can produce different results in an ODS-5 environment.

You can switch from the TRADITIONAL to the EXTENDED parsing style, and this section describes the following areas that may be affected if you choose to do so:

- Command procedure file specification
- Case preservation and $FILE
- Ampersand versus apostrophe substitution

See Section 3.4.1 for more information on switching between parsing styles.

### 3.4.3 Command Procedure File Specification

If indirect command procedures are used, you may need to put quotes around some procedure arguments.

The following examples show the differences in output between TRADITIONAL and EXTENDED parsing styles when using the same command file, SS.COM:

           $ create ss.com
           $ if p1 .nes. "" then write sys$output "p1 = ",p1
           $ if p2 .nes. "" then write sys$output "p2 = ",p2
           $ if p3 .nes. "" then write sys$output "p3 = ",p3

- Setting the parsing style to TRADITIONAL and running SS.COM produces the following output:

             $ set process/parse_style=traditional
             $ @ss ^ parg2 parg3
             p1 = ^
             p2 = PARG2
             p3 = PARG3

  Note that the circumflex (^) is the first argument (not an escape character), and that case is not preserved for the p2 and p3 procedure arguments.
- Setting the parsing style to EXTENDED produces the following output when running the same command procedure:

             $ set process/parse_style=extended
             $ @ss ^ parg2 parg3
             p1 = ^ PARG2
             p2 = PARG3

  Note that the command procedure recognizes the circumflex (^) as the escape character that identifies the space as a literal character rather than an argument separator, and that "^ PARG2" is the first argument. Case is not preserved.
- Adding quotes to the circumflex (^) produces the following results:

             $ @ss "^" parg2 parg3
             p1 = ^
             p2 = PARG2
             p3 = PARG3

  Because the circumflex (^) is within a quoted string, it is not treated as an escape character.
- Adding quotes to the p3 argument produces the following result:

             $ @ss "^" parg2 "parg3"
             p1 = ^
             p2 = PARG2
             p3 = parg3

  Note that case is preserved for the p3 procedure argument.
- When the parsing style is set to TRADITIONAL, the following command treats the circumflex (^) and the parg2 and parg3 strings as procedure arguments, and the command procedure produces the following results:

             $ set process/parse_style=traditional
             $ @ss^ parg2 parg3
             p1 = ^
             p2 = PARG2
             p3 = PARG3

- When the parsing style is set to EXTENDED, the circumflex (^) is treated as an escape character that identifies the space as a literal character. DCL looks for the file "SS^_PARG2.COM" and produces the error shown in the following example:

             $ set process/parse_style=extended
             $ @ss^ parg2 parg3
             %DCL-E-OPENIN, error opening USER$DISK:[TEST]SS^_PARG2.COM; as input
             -RMS-E-ACC, ACP file access failed
             -SYSTEM-W-BADFILENAME, bad file name syntax

### 3.4.4 Case Preservation and $FILE

DCL attempts to preserve the case of file specifications. It can do this only for commands defined with the Command Definition Utility (CDU). DCL preserves case for any item defined in the command definition file (.CLD) with the $FILE parse type.

Refer to the OpenVMS Command Definition, Librarian, and Message Utilities Manual for more information.

### 3.4.5 Ampersand Versus Apostrophe Substitution

You can use ampersand (&) substitution, as opposed to apostrophe substitution, to preserve case during traditional parsing.

The following traditional parsing example shows a series of commands that change the case of a character string:

           $ set process/parse_style=traditional
           $ x = "string"
           $ define y 'x'
           $ sho log y
              "Y" = "STRING" (LNM$PROCESS_TABLE)
           $ define y &x
           %DCL-I-SUPERSEDE, previous value of Y has been superseded
           $ sho log y
              "Y" = "string" (LNM$PROCESS_TABLE)

Note that the use of the ampersand (&) preserved the case of the character string assigned to the x variable.

Apostrophe substitution takes place before the command line is set to uppercase, and ampersand substitution takes place after the command line is set to uppercase.

The following extended parsing example shows the same series of commands:

           $ set process/parse_style=extended
           $ define y 'x'
           %DCL-I-SUPERSEDE, previous value of Y has been superseded
           $ sho log y
              "Y" = "string" (LNM$PROCESS_TABLE)
           $ define y &x
           %DCL-I-SUPERSEDE, previous value of Y has been superseded
           $ sho log y
              "Y" = "string" (LNM$PROCESS_TABLE)

Note that both character strings for the y variable are returned lowercase. This happens because the DEFINE command uses $FILE, which preserves the case.

Ampersand substitution can therefore be used to specify EXTENDED file names even though the parsing style is set to TRADITIONAL, as shown in the following example:

    $ set process/parse=extended
    $ cre file^ name.doc
    Contents of an ODS5 file
     Exit

    $ set process/parse=traditional
    $ a = "file^ name.doc"
    $ type file^ name.doc
    %DCL-W-PARMDEL, invalid parameter delimiter - check use of special characters
     \^NAME\
    $ type 'a'
    %DCL-W-PARMDEL, invalid parameter delimiter - check use of special characters
     \^NAME\
    $ type &a
    Contents of an ODS5 file

Note Ampersand substitution does not work for foreign commands.

## 3.5 DCL Commands and Utilities

Some DCL commands and OpenVMS utilities have been modified to take advantage of all the features of extended file names. These utilities and commands accept and handle extended file specifications without error and without modifying their expected case.

Other DCL commands and OpenVMS utilities 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.

See Table 3-3 for the new features in DCL to support Extended File Specifications.

Section 2.1 fully defines the different levels of support for extended file names provided by DCL commands and OpenVMS utilities in OpenVMS Version 7.2.

The following DCL commands and OpenVMS utilities provide full support for extended file names:

> ANALYZE /AUDIT
> ANALYZE /DISK
> ANALYZE /RMS
> BACKUP
> CONVERT
> CONVERT /RECLAIM
> COPY
> CREATE /DIRECTORY
> DELETE
> DIRECTORY
> DUMP
> EDIT /ACL
> EXCHANGE /NETWORK
> FDL
> PURGE
> RECOVER/RMS
> RENAME
> SEARCH
> SET SECURITY
> SYSMAN
> TYPE

Table 3-3 lists the new features in DCL to support Extended File Specifications.

Table 3-3 DCL New Features
DCL Command | New Features
--- | ---
COPY | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
DELETE | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
DIRECTORY | Added the following items: Qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED Display item to /FULL to display Client Attributes
DUMP | Added the following items: Display item to /DIRECTORY to display Name type attribute Display item to /HEADER to display new attributes Qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
EXCHANGE NETWORK | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
F$FILE_ATTRIBUTES Lexical | Added new item codes: FILE_LENGTH_HINT, VERLIMIT, DIRECTORY
F$GETDVI Lexical | Added new type to the ACPTYPE item code.
F$GETJPI Lexical | Added new item codes: PARSE_STYLE_PERM and PARSE_STYLE_IMAGE
INITIALIZE | Added a new qualifier: /STRUCTURE=5 device-name[:] volume-label
PRINT | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
PURGE | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
RENAME | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SEARCH | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SET ACL | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SET DEFAULT | Modified the directory-spec parameter to accept ODS-5-compliant file specifications.
SET DIRECTORY | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SET FILE | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SET PROCESS | Added a new qualifier: /PARSE_STYLE=(keyword), where keywords are TRADITIONAL and EXTENDED.
SET SECURITY | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
SET VOLUME | Added a new qualifier: /STRUCTURE_LEVEL=5
SHOW DEVICE/FULL | Updated the display information to show the disk structure level.
SUBMIT | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED
TYPE | Added new qualifier, /STYLE, with new keywords, EXPANDED and CONDENSED

For detailed information about the enhancements made to the OpenVMS operating system and utilities in support of Extended File Specifications, see the OpenVMS DCL Dictionary: A--M, the OpenVMS DCL Dictionary: N--Z, and the OpenVMS Utility Routines Manual.

## 3.6 Displaying Files with Extended Names

Some DCL commands, as listed in Table 3-3, 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.

### 3.6.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.

### 3.6.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]

Previous | Next | Contents | Index

| privacy and legal statement |
6536PRO_003.HTML