【发布时间】:2022-01-17 00:20:03
【问题描述】:
我正在尝试通过编写一个计算 BMI 的程序来学习一些基本的 DS2 编程。我编写了一个程序,但我收到“错误:第 47 行:尝试从 void 表达式获取值。”。我做错了什么?
这是我的程序:
proc ds2;
data _null_;
dcl double bmi;
method bmi_calc(double height, double weight);
dcl double bmi;
bmi = weight/(height * height);
end;
method init();
weight = 70.5;
height = 1.68;
end;
method run();
bmi = bmi_calc(height, weight);
put 'BMI IS: ' bmi;
end;
method term();
put bmi;
end;
enddata;
run;
quit;
【问题讨论】: