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.