Before your program can read or write to the devices on the system, a device description that identifies the hardware capabilities of the device to the operating system must be created when the device is configured. A device file specifies how a device can be used. By referring to a specific device file, your RPG program uses the device in the way that it is described to the system. The device file formats output data from your RPG program for presentation to the device, and formats input data from the device for presentation to your RPG program.
You use the device files listed in Table 49 to access the associated externally attached devices:
Device File | Associated Externally Attached Device | CL commands | RPG Device Name |
---|---|---|---|
Printer Files | Provide access to printer devices and describe the format of printed output. |
CRTPRTF CHGPRTF OVRPRTF |
PRINTER |
Tape Files | Provide access to data files which are stored on tape devices. |
CRTTAPF CHGTAPF OVRTAPF |
SEQ |
Diskette Files | Provide access to data files which are stored on diskette devices. |
CRTDKTF CHGDKTF OVRDKTF |
DISK |
Display Files | Provide access to display devices. |
CRTDSPF CHGDSPF OVRDSPF |
WORKSTN |
ICF Files | Allow a program on one system to communicate with a program on the same system or another system. |
CRTICFF CHGICFF OVRICFF |
WORKSTN |
The device file contains the file description, which identifies the device to be used; it does not contain data.