Download 5 - Parent Directory

Transcript
DCL Details
8.10
Why doesn’t DCL symbol substitution work?
The DCL symbol substitution processing occurs only at the DCL prompt,
not within data and not within files. If you wish to perform symbol
substitution in this environment, you typically write a small file
containing the command(s) and data to be invoked—potentially only
the data—and you then invoke the created procedure or reference the
specified data.
In this case, use of a file containing nolinemode commands or other
techniques might be useful—you will want to ensure that the text editor
you use does not attempt to use screen mode or similar, as this is not
generally considered adventageous within a command procedure.
Tools such as FTP have alternatives: COPY/FTP.
DCL symbol substitution occurs in two passes, using the ampersand and
the apostrophe. In most cases, only the apostrophe is necessary. In a
few cases—such as the DCL PIPE command—you will may need to use
the ampersand to get the substitution to work. The following example
uses ampersand substitution to transfer the contents of the header into a
logical name:
$ PIPE CC/VERSION | (READ SYS$PIPE hdr ; DEFINE/JOB/NOLOG hdr &hdr )
A logical name (in the job logical name table; shared by all processes in
the current job) was used as DCL symbols cannot be returned back out
from a DCL PIPE or other spawned subprocess.
For related materials, please see Section 8.1 and Section 8.11.
8.11
How can I substitute symbols in a PIPE?
Use DCL ampersand substitution, and not apostrophe substitution.
$ pipe show system | search sys$input opcom | (read sys$input pid ;
pid=f$element(0," ",pid) ; define/system opcom_pid &pid)
$ show log opcom_pid
"OPCOM_PID" = "0000020B" (LNM$SYSTEM_TABLE)
8–8