DO IF
Starts a block of transformations executed for cases meeting a condition, with optional ELSE IF / ELSE branches.
Syntax
Section titled “Syntax”DO IF (condition). transformations[ELSE IF (condition). transformations][ELSE. transformations]END IF.Synopsis
Section titled “Synopsis”| Kind | Transformation (pending until data is needed) |
| Body | free-form body |
| Changes data | yes, undoable |
Examples
Section titled “Examples”DO IF (age < 18). COMPUTE group = 1.ELSE IF (age < 65). COMPUTE group = 2.ELSE. COMPUTE group = 3.END IF.- If a condition evaluates to missing, the whole block is skipped for that case, including later branches.
- Blocks nest to any depth. A DO IF without END IF is reported when the transformations run.
Related
Section titled “Related”Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.