Accessing Devices
On a Windows system, you must use device numbers for interjob communication devices, and routine interlock devices. For terminals and printers, you can use device mnemonics or device numbers you assign.
On a UNIX® system, you can use UNIX® file specifications to refer to files or you can set up device numbers to refer to files.
You can access a device in one of two ways:
Allowing Users to Select Devices with the ^%IS Utility
If you want users of a character-based application to select a device interactively, call the ^%IS utility from the application. You can learn more about the ^%IS utility in Allowing Users to Specify a Device.
To select a device using the ^%IS utility:
-
At the Device: prompt, enter a device mnemonic.
Predefined Mnemonic Spaces
Mnemonic |
Corresponding Device |
<ENTER> |
Terminal screen |
SPOOL |
Spooler |
2 |
Spooler |
|PRN| |
Default Windows Printer |
File name: MYFILE.TXT DEV$:[TEST]MYFILE.TXT C:\MGR\MYFILE.TXT |
File at path specified or, if no path specification, in current directory. |
-
Depending on the type of device, you see another prompt:
Device Utilities
Device |
Prompt |
Valid Responses |
Terminal |
Right Margin |
A number representing the number of characters per line. |
Printer |
Right Margin |
A number representing the number of characters per line. |
Spooler |
Name (of file) |
A valid file name for the platform, path optional. |
File Name |
Parameters |
A valid parameter list for an OPEN command for the device type. |
Accessing Devices with the OPEN Command
You can use an OPEN command either in the Terminal or within an ObjectScript application to open a specific device for reading and writing. When you specify the device, you can use its Device ID or its alias.
Interpretation Levels for Devices
Device identifiers you use with ^%IS or an OPEN command go through up to three levels of interpretation. Thus, if you enter the mnemonic 47 at the ^%IS Device: prompt, the final device ID that is used may be different. The three levels are described below.
Level 1: %IS Utility Level
The first level is used if a device is selected with the ^%IS utility. Mnemonics in the ^%IS global can be associated with device numbers. The ^%IS utility then issues an OPEN command to that device number.
Level 2: OPEN Command Level
In an OPEN command, InterSystems IRIS checks to see if this number exists in the Alias column of the Device panel table. If so, it translates it to the actual device number or name for that device.
Note:
Be sure not to define an alias that matches a Device ID but is associated with a different device if you want to access that device by its mnemonic from ^%IS.