I'm trying to computer the two way interaction of the independent variables. Below is part of the code that puts the variables E1,E2,E3,E4 and G1 to G15 into arrays: /*Then we need to computer the two way interaction of the independent variables.*/
data new1;
set new;
array ONE[*] E1-E4 G1-G15;
array TWO[*]
e1e2 e1e3 e1e4 e1g1 e1g2 e1g3 e1g4 e1g5 e1g6 e1g7 e1g8 e1g9 e1g10 e1g11 e1g12 e1g13 e1g14 e1g15
e2e3 e2e4 e2g1 e2g2 e2g3 e2g4 e2g5 e2g6 e2g7 e2g8 e2g9 e2g10 e2g11 e2g12 e2g13 e2g14 e2g15
e3e4 e3g1 e3g2 e3g3 e3g4 e3g5 e3g6 e3g7 e3g8 e3g9 e3g10 e3g11 e3g12 e3g13 e3g14 e3g15
e4g1 e4g2 e4g3 e4g4 e4g5 e4g6 e4g7 e4g8 e4g9 e4g10 e4g11 e4g12 e4g13 e4g14 e4g15
g1g2 g1g3 g1g4 g1g5 g1g6 g1g7 g1g8 g1g9 g1g10 g1g11 g1g12 g1g13 g1g14 g1g15
g2g3 g2g4 g2g5 g2g6 g2g7 g2g8 g2g9 g2g10 g2g11 g2g12 g2g13 g2g14 g2g15
g3g4 g3g5 g3g6 g3g7 g3g8 g3g9 g3g10 g3g11 g3g12 g3g13 g3g14 g3g15
g4g5 g4g6 g4g7 g4g8 g4g9 g4g10 g4g11 g4g12 g4g13 g4g14 g4g15
g5g6 g5g7 g5g8 g5g9 g5g10 g5g11 g5g12 g5g13 g5g14 g5g15
g6g7 g6g8 g6g9 g6g10 g6g11 g6g12 g6g13 g6g14 g6g15
g7g8 g7g9 g7g10 g7g11 g7g12 g7g13 g7g14 g7g15
g8g9 g8g10 g8g11 g8g12 g8g13 g8g14 g8g15
g9g10 g9g11 g9g12 g9g13 g9g14 g9g15
g10g11 g10g12 g10g13 g10g14 g10g15
g11g12 g11g13 g11g14 g11g15
g12g13 g12g14 g12g15
g13g14 g13g15
g14g15
n = 0;
do i = 1 to dim(ONE);
do j = i+1 to dim(ONE);
n = n+1;
TWO(n)= ONE(i)*ONE(j);
end;
end;
run; After n =0; This error is returned : ERROR 22-322: Syntax error, expecting one of the following: a name, (, -, :, ;, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 76-322: Syntax error, statement will be ignored. After TWO(n)= ONE(i)*ONE(j); returns ERROR: Too many array subscripts specified for array TWO. What am I doing wrong?
... View more