Take records

Filter:

TAKE

Syntax:

TAKE [whichend] Nrecords

Operands:

Nrecords :: integer > 0 | *
whichend :: FIRST (default) | LAST

Functional Description:

Use the TAKE stage to select one or more records at the beginning or end of its primary input stream. TAKE copies the selected records to its primary output stream. If its secondary output stream is connected, TAKE passes any unselected records to its secondary output stream.

FIRST selects records from the beginning of the input stream. This is the default.

LAST discards records until only the specified number remain, and takes the last specified number of records from the end of the input stream.

n is the number of records to take to the input stream. The default is 1. If you specify 0 for n, no records in the primary input stream are selected.

* specifies that all records are taken. No records are passed to the secondary output stream.

Secondary Input/Output:

OUTPUTs

Synonyms:

none

Usage Notes:

The following example will take the first 10 records.

| TAKE first 10 |

The following example will take the last 7 records.

| TAKE last 7 |

The following example will take the last 7 records and place remaining in file OUTFILE

| b: TAKE last 7 | ? b: | > OUTFILE


JAVA Pipelines

Cullen Programming logo