BUFFER stage v1.1 |
Pipelines v1.9 |
Purpose, Operands, Streams used, Usage notes, Examples, See also |
Syntax |
>>__BUFFER__ _________ __ _________________ ___________________________________________><
|_REVerse_| |_sets_ ________ _|
|_string_|
Purpose |
Use the BUFFER
stage without operands to accumulate all the records (including null records)
from its primary input stream, not passing any of the records until end-of-file
is reached on the primary input stream. When BUFFER reaches end-of-file on its
primary input stream, it writes all the records to its primary output stream.
Use the BUFFER stage
with an operand to accumulate input records until a null record is read or
end-of-file is reached. BUFFER writes this set of input records the specified
number of times. If you specify a number greater than one, a null record or a
record containing the specified string
is written between the copies of the set of input records. Then BUFFER copies
the null input record or the specified string
to its primary output stream. This process continues until BUFFER reaches
end-of-file on its primary input stream and all sets of input records have been written.
Operands |
Streams used |
The following streams are used by the BUFFER
stage:
Stream
|
Action |
|
|
Primary input stream |
BUFFER
reads records from its primary input stream. |
Primary output stream |
After reading all its input records or a null input record, BUFFER
copies the records to its primary output stream. |
Usage notes |
1) |
If no operands are specified, BUFFER delays the records until end-of-file is reached. If one or more operands
are specified, BUFFER delays the records until the end of a set of input
records is reached. |
2) |
If you use the same input streams, identical output
streams are produced by the following two buffer stages: . . . | buffer | .
. .
. . . | buffer 1 | . . .
The
timing of the output records is different if there are null records in the
input stream. When used without operands, BUFFER reads all input records
before writing output records. When used with operands, BUFFER produces its
first output record after it reads the first null record. |
3) |
A BUFFER stage
can be used to prevent a pipeline from stalling. See: pipeline
stalls for an explanation. |
4) |
BUFFER verifies
that its secondary input and output streams are not connected and then begins
execution. |
Examples |
See also |
Reference the following links for additional information:
|