OVERLAY stage v1.0

Pipelines v1.9

 

Purpose, Operands, Streams used, Usage notes, Examples, See also

Home

 

Syntax

 

              _SPACE_

>>__OVERlay__|_______|_________________________________________________________________><
             |_char__|

 

Purpose

 

Use the OVERLAY stage to read one record from each connected input stream and create a single output record such that each position in the output record contains the character in the relative position from the highest-numbered input stream. OVERLAY writes the output record to its primary output stream.

 

One character has the property that it does not overlay a character from a lower-numbered stream. By default, this character is a space. The operand may select a different character. If a record in the highest-numbered input stream contains the specified character in any position, OVERLAY replaces the character in the output record with the corresponding character from the next highest-numbered input stream that has something other than the specified character in that position.

 

Operands

 

    

SPACE

specifies that a space character (hexadecimal value; x’20’) is the overlay character. This is the default.

 

    

char

is a character which does not overlay data on lower-numbered input streams.

 

Streams used

 

The following streams are used by the OVERLAY stage:

 

Stream

Action

 

 

Input streams

OVERLAY reads records from each connected input stream.

Primary output stream

After reading a record from each of its connected input streams, OVERLAY combines the records into a single output record which it writes to its primary output stream.

 

Usage notes

 

     1)

OVERLAY delays one record.

 

     2)

If the OVERLAY stage discovers that its primary output stream is not connected, the OVERLAY stage ends.

 

     3)

If a position in each input stream contains the specified character, OVERLAY places that character in the output record.

 

     4)

If a record in the highest-numbered input stream is not as long as a lower-numbered input stream record, OVERLAY writes the remaining characters from the lower-numbered input stream records to the output stream.

 

     5)

If OVERLAY processes input streams where one input stream does not have a record to compare, it compares the records from the other streams. Consider the following streams:

 

stream 0 contains 12 records
stream 1 contains 14 records
stream 2 contains 10 records

 

OVERLAY combines the first 10 records from all three streams and writes those records to its output stream. Then it compares the 11th and 12th records of its primary and secondary input streams and writes those two records to its output stream. Finally, OVERLAY copies the 13th and 14th records from its secondary input stream to its output stream.

 

     6)

OVERLAY reads a record from an input stream, processes it, and then releases it before it reads a record from the next highest input stream or writes to its output stream.

 

     7)

OVERLAY processes input records until all input streams reach the end-of-file.

 

     8)

OVERLAY verifies that its secondary output stream is not connected and then begins execution.

 

Examples

 

     1)

The following diagram shows two input streams for OVERLAY and its resulting output stream, where char is SPACE; the default.

 

 

     2)

This next diagram uses the same input stream data, but specifies char as A.

 

 

See also

 

Reference the following link for additional information:

 

SPECS