Kbase 16608: Using VMS Logicals with PROPATH and the 4GL
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Using VMS Logicals with PROPATH and the 4GL
The purpose of the kbase is to attempt to explain how VMS
logicals can be used within Progress, both within the
PROPATH logical, and within 4gl procedures.
While VMS logicals are similar to UNIX environment
variables, there are some slight differences. Foremost of
these is the use of ROOTED or CONCEALED logicals in the VMS
system and the inclusion of files and files within
subdirectories from a rooted or concealed location.
There is a general rule to follow when using logicals in
Progress:
"If it works with the DCL command 'DIRECTORY', then it
works in Progress."
For example, if you define your PROPATH as:
$ DEFINE PROPATH ",<expression1>,<expression2>"
It should work if you can type from the VMS command line:
$ DIRECTORY <expression1>
$ DIRECTORY <expression2>
If DIRECTORY gives you a directory listing, it should work.
To illustrate the use of logicals with PROPATH and the
Progress 4gl, lets look at some examples.
1. CORRECT WAY TO DEFINE 'PATH' LOGICALS
The concept of a 'path' variable is really not a VMS
concept, so defining logicals that can be used in PROPATH
and in the 4gl may differ a bit from the way it works in
other operating systems. As an example, suppose we have
two directories on our system where procedures are kept:
DISK1:[PROGRESS.CODE.DIR1]
DISK1:[PROGRESS.CODE.DIR2]
If we want to define logicals for these paths, and then later
use these logicals in PROPATH and the 4gl, the way we define the
logicals depends on whether only files will be accessed from
the directories, or if subdirectories will also be accessed.
If we keep ONLY files in these directories and there are NO
SUBDIRECTORIES, then we can simply DEFINE logicals to
"point at" the two directories with files, such as:
$ DEFINE DIR1 DISK1:[PROGRESS.CODE.DIR1]
$ DEFINE DIR2 DISK1:[PROGRESS.CODE.DIR2]
However, if we need to access file AND SUBDIRECTORIES from
a directory, we will need to use ROOTED or CONCEALED
logicals as follows:
$ DEFINE /TRANS=CONC DIR1 DISK1:[PROGRESS.CODE.DIR1.]
$ DEFINE /TRANS=CONC DIR2 DISK1:[PROGRESS.CODE.DIR2.]
Notice the trailing "." and the fact that the logicals are
rooted and concealed - this will allow Progress to find
both files and subdirectories in these directories.
Rooted logicals allow you to force VMS to believe it is
"looking at" the top level of a disk volume rather than
somewhere in a directory tree. "Concealing" the logical
allows you hide from your users the location of these
directories on the disk when using DCL commands such as
DIRECTORY.
If you have no need for rooted/concealed logicals (if you
only need to access files directly from a directory), then
don't use them. They can tend to be confusing.
2. USING ROOTED/CONCEALED LOGICALS IN PROPATH
If you use rooted/concealed logicals to include both files
and files from subdirectories within your PROPATH element
(<expression1> above), then you will need to define your
PROPATH element as follows:
$ DEFINE PROPATH ",DIR1:[000000],DIR2:[000000]"
NOTE: If you only have files in subdirectories, then the
":[000000]" is not necessary, since Progress will
concatenate the PROPATH element and included the file
correctly later on. Keeping the ":[000000]" doesn't cause
problems and could avoid them later on if you decide to
include a file from the root location.
Remember, you can try the DIRECTORY rule to confirm this.
If you define your DIR1 logical as above using
/TRANS=CONCEALED and try:
$ DIRECTORY DIR1
You'll get an error something like:
%DIRECT-E-OPENIN, error opening
DISK1:[PROGRESS.CODE.DIR1]*.*;* as input
-RMS-E-DNF, directory not found
-SYSTEM-W-NOSUCHFILE, no such file
However, if you try:
$ DIRECTORY DIR1:[000000]
It works just fine. When in doubt about a PROPATH, try the
DIRECTORY rule.
Remember when you're using rooted/concealed logicals you
are attempting to mimic having a top-level VMS directory
structure. Many use rooted logicals to allow for directory
trees with a depth greater than 8. Others use them just to
shorten what they need to type.
Now that PROPATH is defined, you can use it to find
procedures. Continuing the example above, suppose you have
a file:
DISK1:[PROGRESS.CODE.DIR1]PROC1.P
Because PROC1.P is in a PROPATH directory, you can run this
from the 4gl with command:
RUN PROC1.P.
Now suppose you have a file:
DISK1:[PROGRESS.CODE.DIR1.SUB1.SUB2]PROC2.P
Because PROC2.P is in a subdirectory of a PROPATH
directory, you can run this from the 4gl with command:
RUN [.SUB1.SUB2]PROC2.P.
Note that if the DIR1 logical was not defined as a
rooted/concealed logical, this would not work. Also note
that for compatibility with Unix systems, you can use Unix
syntax for procedures in subdirectories of PROPATH
directories:
RUN SUB1/SUB2/PROC2.P.
3. USING LOGICALS IN THE 4GL
You can also use logicals in the 4gl, provided they work
with the DIRECTORY rule. For example:
RUN DIR1:[000000.SUB1.SUB2]PROC2.P.
should work, while
RUN DIR1:[.SUB1.SUB2]PROC2.P.
won't (try the DIRECTORY test to convince yourself!)
4. MORE INFORMATION
The Release Notes in README.PRO for 7.3C11 contain
additional information on the use of logicals and PROPATH
with VMS. These Release Notes are also available in the
Progress Knowledge Base; search by words for 7.3C11 and
README.PRO.
Progress Software Technical Support Note # 16608