Input to Rexx programs is in the form of a serial character stream generated
by user interaction or has the characteristics of one generated this way.
You can add characters to the end of some stream objects asynchronously; other
stream objects might be static or synchronous.
The methods and instructions you can use on input stream objects are:
CHARIN
method—reads input stream objects as characters.
LINEIN
method—reads input stream objects as lines.
PARSE PULL and PULL instructions—read the default input stream
object
(
.INPUT), if the external data queue is empty.
PULL is the same as PARSE UPPER PULL.
PARSE LINEIN instruction—reads lines from the default input
stream
object regardless of the state of the external data queue. Usually, you can
use PULL or PARSE PULL to read the default input stream object.
In a persistent stream object, the Rexx language processor maintains a
current read position.
For a persistent stream:
The CHARS
method returns the number of characters currently available in an input stream
object from the read position through the end of the stream (including any
line-end characters).
The LINES
method determines if any data remains between the current read position and
the end of the input stream object.
You can move the read position to an arbitrary point in the
stream object with:
The SEEK or POSITION method of the Stream class
The COMMAND method's SEEK or POSITION argument
The
start
argument of the CHARIN method
The
line
argument of the LINEIN method
When the stream object is opened, this position is the start of the
stream.
In a transient stream, no read position is available. For a transient
stream:
The CHARS and LINES methods attempt to determine if data is
present in the input stream object. These methods return the value
1 for a device if data is
waiting to be read or a determination cannot be made. Otherwise,
these methods return
0.
The SEEK and POSITION methods of the Stream class and the
COMMAND method's
SEEK and
POSITION arguments are not applicable to
transient streams.