The application regards all output as printing, but the output device need not be a printer; for example customer displays and cash drawers may be output devices. Some output devices may be used purely for control purposes. An example of this is an output device which sets parameters to control the subsequent reading of a magnetic stripe by an input device. Such a control device need not correspond to any physical equipment; it might just set up information accessed by the OSDI stripe reader software.
Printer output can only be sent to one POD at a time (in addition to screen output and file output). The POD is preselected by the application program. However, the POD might get translated by the OSDI into multiple physical devices.
Consider the situation where a program must send the text "Ice cream $2.50" to be printed:
On a regular printer at 12 characters to the inch
and
On a customer display attached to a till
In the first case you do not need to use the OSDI. DP4 can route the output to the required printer port and send the required escape sequences by using a POD based on a device group for a regular printer (defined in DFSETUP). The second case normally requires an OSDI to access the customer display, (because the manufacturer's interface to the display probably uses a special library and a program won't be able to access all (or even any) the functionality of the display without using this. The important point is that the application uses the same calls to generate output in both cases, but does not need to know how the data is managed once output has been sent.
In both case A and B, the application programmer calls generic functions to specify the output device and to output data. In both cases the same two calls are made to produce output, differing only in parameter values:
Open the printer, specifying the destination device (regular printer or customer display). The destination device will include device characteristics such as character size
Print the text (same in both cases)
For case A, where there is no OSDI, the printer is addressed through the operating system. The character size is implicitly sent, providing it has been specified as part of the device definition (for example as a suitable escape sequence, or as part of the map definition of a 4.6xx program that prints to the DFPRINT device).
For case B, the display is not attached to a regular printer port, but to a special interface (an OSDI). It is the OSDI that interprets the device definition and characteristics and performs the device-dependent output.
In order to select a device, and any associated print characteristics, your application program selects a POD. In both case A and B there must be a POD definition based on a COD definition. After the POD has been selected DP4 print instructions are used to send output.
If you want to use some other kind of printer at a later date, you do not need to modify your program. You can just allocate a different COD to the POD addressed by your program.