Skip to content

DO IF

Starts a block of transformations executed for cases meeting a condition, with optional ELSE IF / ELSE branches.

DO IF (condition).
transformations
[ELSE IF (condition).
transformations]
[ELSE.
transformations]
END IF.
Kind Transformation (pending until data is needed)
Body free-form body
Changes data yes, undoable
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.

ELSE IF, ELSE, END IF, IF


Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.