5.2. REXX’s Notion of a Stream REXX regards a stream as a sequence of characters, conceptually equivalent to what a user might type at the keyboard. Note that a stream is not generally equivalent to a file. [MCGH:DICT] defines a file as “a collection of related records treated as a unit,” while [OX:CDICT] defines it as “Information held on backing store [...] in order (a) to enable it to persist beyond the time of execution of a single job and/or (b) to overcome space limitations in main memory.” A stream is defined by [OX:CDICT] as “a flow of data characterized by relative long duration and constant rate.” Thus, a file has a flavor of persistency, while a stream has a flavor of sequence and momentarily. For a stream, data read earlier may already have been lost, and the data not yet read may not be currently defined; for instance the input typed at a keyboard or the output of a program. Even though much of the REXX literature use these two terms interchangeably (and after all, there is some overlap), you should bear in mind that there is a difference between them. In this documentation, the term “file” means “a collection of persistent data on secondary storage, to which random access and multiple retrieval are allowed.” The term “stream” means a sequential flow of data from a file or from a sequential device like a terminal, tape, or the output of a program. The term stream is also used in its strict REXX meaning: a handle to/from which a flow of data can be written/read.
PREV NEXT