In reply to Rick Wicklin.

Rick, I had completely forgot about CALL TABULATE, should have checked the docs first! But if I try d = design({1, 2, 2, ., 1}); then I get the error 'Invalid argument or operand; contains missing values'. I am using 13.1.