HELPLIB.HLB  —  Ext File Specs, Using  Command File Specification
    If indirect command procedures are used, you may need to put
    quotes around file specifications.

    The following examples show the differences in output between
    TRADITIONAL and EXTENDED parse 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

    o  Setting the parse style to an ODS-2 environment and running
       SS.COM, the following output occurs:

              $ set process/parse_style=traditional
              $ @ss ^ p2 p3
              p1 = ^
              p2 = P2
              p3 = P3

       Note that the circumflex (^) is the first argument, and that
       the case is not preserved for the p2 and p3 variables.

    o  Setting the parse style to an ODS-5 environment, the following
       output occurs when running the same command procedure:

              $ set process/parse_style=extended
              $ @ss ^ p2 p3
              p1 = ^ P2
              p2 = P3

       Note that the command procedure recognizes the circumflex (^)
       as the escape character, and "^ P2" is the first argument.

    o  Adding quotes to the circumflex (^) produces the following
       outcome:

              $ @ss "^" p2 p3
              p1 = ^
              p2 = P2
              p3 = P3

       Because the circumflex (^) is within a quoted string, it is
       not treated as an escape character.

    o  Adding quotes to the p3 variable produces the following
       outcome:

              $ @ss "^" p2 "p3"
              p1 = ^
              p2 = P2
              p3 = p3

       Note that the case is preserved for the p3 variable.

    o  In an ODS-2 environment, the following command treats the
       circumflex (^) and the p2 and p3 strings as arguments, and the
       command procedure produces the following results:

              $ set process/parse_style=traditional
              $ @ss^ p2 p3
              p1 = ^
              p2 = P2
              p3 = P3

    o  In an ODS-5 environment, the circumflex (^) is treated as
       the escape character and DCL looks for the file "SS^_P2.COM",
       which results in the following error:

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

1  –  Case Preservation and $FILE

    DCL attempts to preserve the casing 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 Command Definition Utility manual for more
    information.

2  –  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 parse 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.
Close Help