错误显示变量X没有给出,但是变量x在声明之前

时间:2018-12-30 00:13:02

标签: sas

尝试在SAS中进行绘制时出现错误,错误提示未给出变量X,但变量x之前已声明。

这是我的代码:

data prg7_5;
do a=1 to 3;
input x@@;
output
end;
cards;
7028 1764 600 7228 2036 744 
7228 2130 804 8448 2536 844
8567 2436 912 9061 2436 1128 
9167 3108 1320 9167 3108 1464 
10032 3108 1608 10051 3208 1896
;
run;
goptions hsize=5 vsize=4 ftext='宋体';
footnote 'the time ';
symbol1 interpol=boxt00 width=1.8 bwidth=5 co=red;
axis1 label  =('temperature(C)')
    value=('190' ' 220 ' '260')
    minor=none
    offset=(10,10);
axis2 label =(angle=90'the time')
    offset=(0,0);
proc gplot data= prg7_5;
    plot x*a/haxis=axis1
        vaxis=axis2;
run;

这是运行日志: enter image description here 您能告诉我正确的方法吗?请帮助

1 个答案:

答案 0 :(得分:2)

输出后需要分号。您的数据集将为空,并且出现以下错误。

  ERROR 117-185: There was 1 unclosed DO block.

 NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.PRG7_5 may be incomplete.  When this step was stopped 
there were 0 observations and 2 variables.
WARNING: Data set WORK.PRG7_5 was not replaced because this step was stopped.

在输出端用分号更改代码,如下所示

 do a=1 to 3;
  input x@@;
  output;
 end;