Use the IGNORE statement for conditional processing. If a record passes the specified conditions, it is ignored and the next record is read and tested. If a record fails the test it is passed on to the next IGNORE or SELECT statement.
VMRGRW uses the following rules for processing IGNORE and SELECT statements:
- If a record passes an IGNORE test, all further tests and processing are ignored, and a new record is read.
- If a record fails an IGNORE test, it is passed to the next SELECT or IGNORE statement.
- If a record passes a SELECT test, subsequent SELECT or IGNORE tests are bypassed and the record is processed using the criteria defined in the SELECT statement the record passed.
- If the record fails a SELECT test, it is passed to the next SELECT or IGNORE statement.
- If a record fails all SELECT and IGNORE tests, it is treated opposite to the last statement in the group. That is, if the last statement is SELECT, the record is ignored, and if the last statement is IGNORE, the record is selected.
IGNORE statements are executed immediately after the record is read, after any NOW MOVE and NOW COMPUTE statements, and before any other processing. If you want to ignore a record after some processing occurs, use the NEXT RECORD statement with the IF and END IF statements.
All SELECT and IGNORE statements in your control file must be entered consecutively. They cannot be separated by any other statements.
IGNORE IF [NOT] cond1 [{OR|AND} [NOT] cond2] ...
- NOT
Reverses the result of the conditional test. - cond1
Indicates that cond1 is required and must be in one of two formats. One format is described in the section Bit Test Statement. The other format is:- fldname1 relation fldname2
Indicates that fldname1 is a field name, fldname2 is a literal or field name, and relation is one of these logical relations:- EQ equal to
- NE not equal to
- GT greater than
- LT less than
- fldname1 relation fldname2
- OR
Indicates that OR is required if another condition follows and AND is not used. OR is used to logically connect the conditions so that the record is ignored if any of the conditions are true. - AND
Indicates that AND is required if another condition follows and OR is not used. AND is used to logically connect the conditions so that the record is ignored only if all conditions are true. - cond2
Indicates that cond defines an additional conditional expression in the same format as cond1. Up to 12 AND clauses or OR clauses may be specified.
Example
This statement has VMRGRW ignore the record if the value for EXPDT is greater than 11000:
IGNORE IF EXPDT GT '11000'.