"IF" checks for a condition - it is not a loop. Maybe you want to have a loop, look at the FOR, WHILE, and LOOP statements.
Other than that, I don't understand your question. Syntactically, the condition is correct - you are only missing the code in the THEN branch and an END IF.