Reputation: 21
Could someone give me a very simple example of a METHOD in SAS DS2 where both RETURNS and RETURN words (statements) are used and it is clear what those words RETURNS and RETURN actually mean.
Upvotes: 0
Views: 201
Reputation: 27508
returns
is a DS2 method
statement definition specifier indicating what kind of value the method returns.return
is a DS2
statement that returns a value to the callerExample
proc ds2;
data _null_;
method minus_one(double operand) returns double;
return operand-1;
end;
method run();
declare double x y;
x = 1;
y = minus_one(x);
put x= y=;
end;
enddata;
run;
quit;
The Proc DS2
documentation is a good place to start if you want basic information.
Upvotes: 1