PROGRESS stage v1.1

Pipelines v2.1

 

Purpose, Operands, Streams, Usage, Examples, Related

Home

 

Need descriptions for examples.

 

Syntax

 

              ┌─1000────┐
>>──PROGRESS──┼─────────┼────────────────────────────────────────────────────────────><
              └─numrecs─┘

 

Purpose

 

Use the PROGRESS stage to write a progress count record after every numrecs input records.

 

PROGRESS reads records from its primary input stream, incrementing a counter each time a record is read. When numrecs records have been read, PROGRESS creates a count record which it writes to either its primary or secondary output stream. When its secondary output stream is not connected, PROGRESS writes the count record to its primary output stream and discards the records from its primary input stream. If both its primary and secondary output streams are connected, PROGRESS copies its primary input stream records to its primary output stream and writes the count record to its secondary output stream.

 

Operands

 

numrecs

is an unsigned integer which specifies the number of records to read before writing a count record. The default the value for numrecs  is 1000.

 

Streams

 

The following streams are used by the PROGRESS stage:

 

Stream

Action

 

 

Primary input stream

PROGRESS reads records from its primary input stream.

Primary output stream

If its secondary output stream is not connected, PROGRESS writes the count record to its primary output stream. If its secondary output stream is connected, PROGRESS copies its primary input stream records to its primary output stream.

Secondary output stream

If its secondary output stream is connected, PROGRESS writes the count record to its secondary output stream.

 

Usage

 

1.

When its secondary output stream is not connected, PROGRESS delays every set of numrecs records. If its secondary output stream is connected, PROGRESS does not delay the primary output stream records.

 

2.

If the PROGRESS stage discovers that all of its output streams are not connected, the PROGRESS stage ends.

 

3.

If the number of input records is less than numrecs, PROGRESS does not produce a count record.

 

4.

The format of the count record is as follows:

 

hh:mm:ss record-count

 

5.

PROGRESS verifies that its secondary input stream is not connected and then begins execution.

 

Examples

 

1.

The following pipeline copies the file in.txt to out.txt. After every 50 records have been copied, the pipeline displays the total number of records copied so far.

 

   **** Top of file ****
 1 Address Rxpipe
 2
 3 'pipe (endchar ?)',
 4    '< in.txt',
 5    '| a: progress 50',
 6    '| > out.txt',
 7    '?',
 8    'a:',
 9    '| console'
10
11 Exit 0
   **** End of file ****

 

2.

Adding a header record

3.

Machine snapshot

4.

 

5.

 

 

Related

 

COUNT

 

History

 

Version

 

Date

Action

Description

Pipelines

1.1

27.12.2021

changed

Application-wide rewrite.

2.1

1.0

06.09.2007

created

First version.

1.0