Unit Record Device Streams
The unit record devices (virtual reader, virtual printer, and virtual
punch) are accessed as transient streams. This means that you cannot
specify a start position or line number
for these streams. You can only write to the end of the stream (for
printer or punch), or read from the next line (for the reader). The
following information is specific to each device:
- READER
- Both LINEIN and CHARIN may be used to get characters from the reader; LINES may be used to get the number of card images in the file, and CHARS may be used to determine if more characters exist. The reader must be defined at address '00C'.
- PRINTER
- Both LINEOUT and CHAROUT are supported, and will write a line to the virtual printer of 132 characters or more. You may write out lines that have a length less than the width of the printer (padding to the printer size is not necessary). The printer must be defined at address '00E'.
- PUNCH
- Both LINEOUT and CHAROUT are supported, and will write a line to the virtual punch of 80 characters. If the output line is more than 80 characters, nothing will be written, and an error will be indicated. If you write fewer than 80 characters, blanks will be added on the right to complete the card image. The punch must be defined at address '00D'.
Note: You should be aware of how CP handles spool files.
In particular, if you open a reader file and do not read any records
or only partially read the file, CP will discard the entire file when
the spool file is closed. In order to prevent this, you can send a
hold command to CP, using the SPOOL, CHANGE, or CLOSE commands. See
z/VM: CP Commands and Utilities Reference for details.