Previous Topic: RELEASE Control StatementNext Topic: SET Control Statement


SELECT Control Statement

The SELECT control statement restricts statement processing to certain database records. The placement of the SELECT control statement is crucial, because it is interrogated at its relative position in the control statement flow. Typically, the SELECT control statement is placed at the beginning of the control statement flow or after the SORT control statement. Only one SELECT control statement is allowed, and it cannot be embedded in an IF or DO control statement.

Syntax

SELECT condition

where condition specifies the condition that is checked to determine which records to select from the database.

Example

To only select the job names that end with P1, specify the following:

/SELECT SUBSTR(JOBNAME,7,2) = 'P1'