Using the PREFIX Verb

The PREFIX verb lets you specify a method of searching for a file through a prefix list. The following steps are performed when locating a file:

If you have access to named disk drives (as in DOS), the DISABLE, ENABLE, and SETDRIVE commands will have an affect on the search pattern used when looking for a file. The SETDRIVE command tells PRO/5 (and the host operating system) what disk drive to use first when looking for a file. The DISABLE command tells PRO/5 what drives to ignore when looking for a file. The ENABLE command tells PRO/5 to stop ignoring a drive that you previously told it to ignore.

Assuming the disk drives "A", "C", and "Z" and the following command:

OPEN(1)"ABC"

PRO/5 would attempt the following file open commands on the system:

C:ABC, A:ABC, Z:ABC (assuming the current disk was "C")

If you are using an operating system that hides the disk drive or drives from you (e.g., the UNIX OS) then you will need to use the PREFIX command to set up a list of directories to be searched.

Assuming you want to search the directories "/basis/pro5" and "/u1/data" you would use the following PREFIX command:

PREFIX "/basis/pro5/ /u1/data/"

Note the trailing slash and the space used as a separator between directory names. PRO/5 simply uses the text provided by the PREFIX command plus your file name in the OPEN to create a file name to be opened. Note also that the current directory is always searched and should never appear in the prefix list.

So, using the examples above, the following would cause ABC, /basis/pro5/ABC, /u1/data/ABC to be searched by the operating system:

PREFIX "/basis/pro5/ /u1/data/"
OPEN (1)"ABC"

Adding the disk drives named above (again assuming the current drive is "C"):

C:ABC, C:/basis/pro5/ABC, C:/u1/data/ABC
A:ABC, A:/basis/pro5/ABC, A:/u1/data/ABC
Z:ABC, Z:/basis/pro5/ABC, Z:/u1/data/ABC

You may reduce the disk drive searching by either eliminating the disk from the search list (using DISABLE) or by placing a disk name on an entry in the PREFIX list. Using the same example as above:

PREFIX "C:/basis/pro5/ Z:/u1/data/"
OPEN(1)"ABC"

The following disk accesses occur:

C:ABC, C:/basis/pro5/ABC
A:ABC
Z:ABC, Z:/u1/data/ABC