SAS阵列尺寸错误

时间:2015-05-12 04:45:23

标签: arrays sas

data t1;
    M = 4;
    array a1{M} _temporary_ (2, 3*1);
    array a2{M} _temporary_(4*.);
run;


ERROR: Too many variables defined for the dimension(s) specified for the array tables.
ERROR 22-322: Syntax error, expecting one of the following: an integer constant, *.  

ERROR 202-322: The option or parameter is not recognized and will be ignored.

为什么我无法通过其他变量定义数组的维度?

1 个答案:

答案 0 :(得分:2)

您不能像这样定义维度,而是可以使用Macro来实现相同的内容,如下所示

 %let   M = 4;
  data t1;
    array a1{&M.} _temporary_ (2, 3*1);
    array a2{&M.} _temporary_(4*.);
run;