# SELECT

Syntax:

Then: select

SELECT can only be used on sort/selection processing tables.

Version Ref: 3.x

Description:

Selects records for further processing by an output table.

SELECT lets you control the selection of individual records while on a sort/selection (-v) table. Like the PRINT command, a record is selected only if it encounters the SELECT command (i.e., it passes a selection condition).

Examples:

If: 4 ne "C"
Then: end
Then: select ; end

When the above code is run against a group of records, only those which have field 4 equal to "C" will be selected and handed to the output process. All other records will not show up in the output. Normally (without any SELECT statement on the processing table) every record will be selected and passed to the final output process. This is the main and only purpose of the SELECT command, and you must be aware of exactly how it functions or you will not understand why some records are showing up in your outputs and others are not. Not only do records have to encounter the SELECT command to be chosen for inclusion in the output phase, but they must meet the designated criteria as well, i.e., if the SELECT statement is encountered AND it has a TRUE "if" condition or a blank "if" condition (which defaults to TRUE), the record will be selected, otherwise it will be dropped out of the output.

Note: SELECT can not select a record more than once.