Stream-oriented data transmission
This chapter describes the input and output statements used in stream-oriented data transmission.
Features that apply to stream-oriented and record-oriented data transmission, including files, file attributes, and opening and closing files, are described in Input and output.
Stream-oriented data transmission treats a data set as a continuous stream of data values in character, graphic, or mixed character data form. Within a program, record boundaries are generally ignored. However, a data set consists of a series of lines of data, and each data set created or accessed by stream-oriented data transmission has a line size associated with it. In general, a line is equivalent to a record in the data set, but the line size does not necessarily equal the record size.
The stream-oriented data transmission statements can also be used for internal data movement, by specifying the STRING option instead of specifying the FILE option. Although the STRING option is not an input/output operation, its use is described in this chapter.
Stream-oriented data transmission can be list-directed, data-directed, or edit-directed.
- List-directed data transmission
- Transmits the values of data-list items without you having to specify the format of the values in the stream. The values are recorded externally as a list of constants, separated by blanks or commas.
- Data-directed data transmission
- Transmits the names of the data-list items, as well as their values, without your having to specify the format of the values in the stream. The GRAPHIC option of the ENVIRONMENT attribute must be specified if any variable name contains a DBCS character, even if no DBCS data is present.
- Edit-directed data transmission
- Transmits the values of data-list items and requires that you specify the format of the values in the stream. The values are recorded externally as a string of characters or graphics to be treated character by character (or graphic by graphic) according to a format list.
The following sections provide details about the data transmission statements and their options, and give instructions on how to specify the list-, data-, and edit-directed data. For information about how to accommodate double-byte characters, see DBCS data in stream I/O.