T.select(x;f)

Read(191) Label: pseudo table, bin file,

Description:

Define a record filtering operation on a pseudo table, return a new pseudo table, and write ineligible records to a bin file.

Syntax:

T.select(x;f)

Note:

The function defines a computation on pseudo table T, which will compute expression x on each of its records, get records that make x return true and return them to a new pseudo table, and writes records that make x return false into bin file f.

Parameter:

T

A pseudo table

x

A Boolean expression

f

A bin file

Return value:

Pseudo table

Example:

 

A

 

1

=create(file).record(["EMPLOYEE.ctx"])

 

2

=pseudo(A1)

Generate a pseudo table from a composite table.

3

=file("emp_NOTHR.btx")

 

4

=A2.select(DEPT=="HR";A3)

Define a computation on A2’s pseudo table, which will get records that meet the condition DEPT=="HR" and return them to a new pseudo table, and write records not meeting the condition into bin file emp_NOTHR.btx in the main directory.

5

=A4.import()

Import data from A4’s pseudo table while executing the computation defined in A4 on A2’s pseudo table, and generate bin file emp_NOTHR.btx. Below is the data A5 returns: