Aside from the missing semi-colon for the ARRAY TWO statement as mentioned by Tom, I have these observations on the messages you get. It says "syntax error. statement will be ignored". That means the "array two" statement is ignored. So the subsequent attempt to use the expression two{n} generates the "too many subscripts" messages. All due to the missing semicolon.
But I actually would like you to consider an alternative based on these observations.
You obviously want the cross-products of ONE put into the upper triangle of a 2-dimensional matrix. But you've defined that upper triangle as a one-dimensional array. Instead make the calculation easier by defining a 2-dimensional array ("array two{19,19"}. You can still calculate only the upper triangle. You don't need to use the unintuitive N to index array TWO. Just use a row index and a column index.
Use the power of SAS to generate variable name lists to minimize your risk of typing error (e.g. g3g4-g3g15 generates all the names from g3g4, g3g5, g3g6 .... g3g14, g3g15).
Use the names DUM1, DUM2 ... etc. for the lower triangle and diagonal elements of the matrix. Then you can drop them from output with a very simple statement. Note you can reuse the same name for multiple elements of the array. SAS doesn't care.
data new1;
set new;
array ONE[*] E1-E4 G1-G15;
array TWO[19,19]
dum1 e1e2-e1e4 e1g1-e1g15
dum1-dum2 e2e3-e2e4 e2g1-e2g15
dum1-dum3 e3e4 e3g1-e3g15
dum1-dum4 e4g1-e4g15
dum1-dum5 g1g2-g1g15
dum1-dum6 g2g3-g2g15
dum1-dum7 g3g4-g3g15
dum1-dum8 g4g5-g4g15
dum1-dum9 g5g6-g5g15
dum1-dum10 g6g7-g6g15
dum1-dum11 g7g8-g7g15
dum1-dum12 g8g9-g8g15
dum1-dum13 g9g10-g9g15
dum1-dum14 g10g11-g10g15
dum1-dum15 g11g12-g11g15
dum1-dum16 g12g13-g12g15
dum1-dum17 g13g14-g13g15
dum1-dum18 g14g15 ;
do r=1 to dim(one);
do c=r+1 to dim(one);
two{r,c}=one{r}*one{c};
end;
end;
drop dum1-dum18 r c;
run;
And out of curiosity why aren't you getting the squares as well as the cross-products?
... View more