Value of control variable expression of DO instruction must be numeric; found "value"

Synopsis
An error in the value of the variable used to count how many times to execute a DO loop, for example attempting specify the count as some non-numeric value, as so:

DO i = 1 TO 5
   i = 'hello' /* changed i to non-numeric */
END
value is the incorrect value of the loop variable.

Cause
You stored a numeric value in a variable, and then when using that variable, you put the name of the variable in quotes, thus mistakenly using the variable's name rather than its numeric value.

Cure
Do not put your variable name in quotes when used in a DO instruction.

Cause
You used a variable that was never assigned any value. Therefore, its default value is its name in capital letters. A variable's name is not a numeric value.

Cure
Make sure that you assign a numeric value to the variable before using it in some mathematical expression. You can trap the NOVALUE condition to catch errors of this nature.

Cause
You used a compound variable for your loop counter, then inside of the loop, you changed the value of a variable with the same name as one of the tails of your loop counter. Therefore, tail name substitution was performed, and now your loop counter variable is referencing some other variable that doesn't have a numeric value. For example:

DO MyVar.i = 1 TO 5
   i = 'hello' /* changed i to some other variable.
                Now the loop counter's real name is
                MyVar.hello after substitution. */
END
Cure
Make sure that you don't unintentionally change the value of a variable with the same name as one of the tails of your loop counter -- at least not inside of the loop using that counter variable.