Example 6: Using the SUBROUTINE Statement with a CALL Statement
Details
The following is an example of the SUBROUTINE statement. The SUBROUTINE
statement creates an independent computational block of code that can be used with a
CALL statement.
Program
proc fcmp outlib=sasuser.funcs.temp;
subroutine inverse(in,inv) group="generic";
outargs inv;
if in=0 then inv=.;
else inv=1/in;
endsub;
options cmplib=sasuser.funcs;
data _null_;
x=5;
call inverse(x, y);
put x= y=;
run;
Log
Log 21.8Results from Using the SUBROUTINE Statement in PROC FCMP
x=5 y=0.2
Example 7: Using Graph Template Language (GTL) with User-Defined
Functions
Features:PROC FCMP functions
OSCILLATE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.