HOLE stage v1.0

Pipelines v2.0

 

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

Home

 

Syntax

 

>>__HOLE_______________________________________________________________________________><

 

Purpose

 

Use the HOLE stage to read all input records and discard them. HOLE reads records from all of its connected input streams and does not write any records to any output stream. The HOLE stage terminates when all of its input streams have reached end-of-file.

 

Operands

 

None.

 

Streams used

 

The following streams are used by the HOLE stage:

 

Stream

Action

 

 

Primary input stream

HOLE reads records from all connected input streams.

Primary output stream

Although HOLE does not write any records to its primary output stream, the output stream stays connected until all input streams have reached end-of-file.

 

Usage notes

 

     1)

Delaying the records does not apply to HOLE because it does not write any output records.

 

     2)

HOLE pulls records through a pipeline when an earlier stage would otherwise end because of receiving an end-of-file on its output stream.

 

     3)

HOLE verifies that its secondary input and secondary output streams are not connected and then begins execution.

 

Examples

 

The following pipeline collates the two input files; master.txt and detail.txt , producing two output files; missing.txt and new.txt. The HOLE stage discards all its input records and only ends once it receives an end-of-file. This ensures that the COLLATE stage does not end prematurely.

 

**** Top of file ****
01 Address Rxpipe
02
03 ‘pipe (endchar ?)’,
04    ‘< c:\master.txt’,               /* Read master input file. */
05    ‘| sort’,                        /* COLLATE expects a sorted input. */
06    ‘| c: collate’,                  /* Find matches. */
07    ‘| hole’,                        /* Discard matching records. */
08    ‘?’,
09    ‘< c:\detail.txt’,               /* Read detail input file. */
10    ‘| sort’,                        /* COLLATE expects a sorted input. */
11    ‘| c:’,                          /* Define secondary streams for COLLATE. */
12    ‘| > c:\missing.txt’,            /* Write missing records. */
13    ‘?’,
14    ‘c:’,                            /* Define tertiary output for COLLATE. */
15    ‘| > c:\new.txt’,                /* Write new records. */
16    ‘?’,
17    ‘literal /Wait..collating./’,    /* Console info message. */
18    ‘| cons’                         /* Write it to the console. */
19
20 Exit 0
**** End of file ****
 

See also

 

Reference the following links for additional information:

 

DROP, DUPLICATE, TAKE

 

History of change

 

None.