Previous Topic: #GETSTG ExampleNext Topic: @IF Syntax


@IF—tests for the presence of member record occurrences

The @IF statement allows you to test for the presence of member record occurrences in a set or to determine the membership status of a record occurrence in a specified set; once the set has been evaluated, the @IF statement specifies further action based on the outcome of the evaluation. For example, you might use an @IF statement to determine whether a set occurrence is empty and, if it is empty, to erase the owner record.

Note: Native VSAM users—This statement is not allowed for sets defined with member records that are stored in native VSAM data sets.

Each @IF statement contains a conditional phrase and a branch statement. When an @IF is issued, the DML precompiler first generates a call to CA IDMS/DB to execute the conditional phrase. CA IDMS/DB tests for a status code of 0000 or 1601, as requested in the conditional phrase; the results of the test determine whether or not the branch statement is executed.

Currency

Depending on its format, the @IF statement uses set or run-unit currency. The set occurrence of an @IF statement is determined by the current record of the named set; the named record occurrence is the record that is current of run unit.

Currency is not updated after execution of the @IF statement.