FILTER [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
FILTER
The FILTER statement starts the database retrieval process for HP
Business BASIC/XL's Data Base Sort Feature. A boolean expression that
can contain both built-in or user-defined functions, is used as the
search condition. When the FILTER statement is executed, the data sets
contained in the thread list are accessed in the order and hierarchy
specified by the THREAD IS statement. The data retrieved from each data
set are unpacked into the local variables as defined in the respective IN
DATASET statement. For each data set from the thread list, the search
condition is evaluated. If the search condition is true, the record
pointers of the data set records that have been read are written out to
the workfile; otherwise, they are ignored and the next data set record is
searched.
If a search condition is not needed, the keyword ALL can be used to
retrieve all the records.
The FILTER statement expects the workfile to be non-empty. If the
workfile is empty and the FILTER statement is executed, an error occurs.
Syntax
{search_condition}
FILTER USING line_id; {ALL }
Parameters
line_id Line label on line number that identifies the line that
defines the THREAD IS statement.
search_ Any logical expression.
condition
Examples
The following examples show the use of the FILTER statement.
400 FILTER USING 300; ALL
410 FILTER USING Thread_list; TRIM$(Name$)="widgets" AND
Price < .25
MPE/iX 5.0 Documentation