Here's a very odd glitch with CHOOSE that I discovered recently. Try this:

a = J(1,6,0);
b = J(1,6,1);
i = 2;
a = choose(i=1,b,a//b);

In words, if i = 1, I want 'a' to become 'b', otherwise, I want 'b' to be appended to 'a'. Doesn't work.
Now, replace the CHOOSE statement in the code above with the following equivalent if/then/else statement:
if i=1 then a = b; else a = a//b;

It will work. Why ? I've heard tons of teachers and manuals tell me the CHOOSE statement is just a more compact form of the if/else statement. Doesn't seem to be.