I am trying to learn some basic DS2 programming by writing a program that calculates BMI. I have written a program but I am getting 'ERROR: Line 47: Attempt to obtain a value from a void expression.'. What am I doing wrong?
Here is my program:
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;