


File names referenced in an ASSIGN clause can be dynamically reassigned at runtime by configuration variables (this is sometimes referred to as name aliasing). Each file's ASSIGN name is searched for in the configuration environment and, if found, replaced by the value of the matching configuration variable. The exact meaning of this reassignment is detailed in the section below on File Name Interpretation (2.8).
For example, if your code contains a SELECT statement like:
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT idx-file
ASSIGN TO DISK "idx.dat"
BINARY SEQUENTIAL
STATUS IS idx-status.
you could define a name alias for "idx.dat" in your runtime configuration file by adding the line:
idx.dat /usr2/data/idx.dat
Whenever your application references "idx.dat" in a SELECT statement, the alias "/usr2/data/idx.dat" is substituted.
Remote name notation is allowed for file aliases if your runtime is client-enabled (for indexed files, remote name notation requires the Vision file system). See sections 5.2.1 and 5.2.2 for more information about client-enabled runtimes and remote name notation.
| PRINTER
| System spooler, default printer
|
| PRINTER1-9
| System spooler, printers 1-9
|
| FORM
| Default special-form printer
|
| FORM1-9
| Special-form printers 1-9
|
| TAPE
| Default tape/floppy transport
|
| TAPE1-9
| Tape/floppy transports 1-9 |
ASSIGN TO PRINT "PRINTER2"
Although the assignment of these names to physical devices is arbitrary, the following conventions are recommended:
a) "PRINTER" devices should be assigned to the host operating system's spooler, if applicable. If the host operating system does not have a spooler, then they should be assigned directly to the print devices.
b) "FORM" devices should not be assigned to a spooler. They should, instead, be assigned directly to the printer. These are intended to be used by programs that need to control the printer directly without intervention by another program.
c) "TAPE" devices can be assigned in any sensible manner.
No names are initially assigned except on MS-DOS systems where the name "PRINTER" is initially assigned to the "PRN" device. You can change this by simply assigning a different value to "PRINTER". This process is covered in more detail in the section 2.8, "File Name Interpretation."