Procedure features: |
INT
statements |
KIND= prototype argument |
|
Other features: |
|
This example shows how to use PROC PROTO to prototype two external C
language functions called SPLIT and CASHFLOW. These functions are contained
in the two shared libraries that are specified by the LINK statements.
|
options nodate pageno=1 linesize=80 pagesize=40; |
|
proc proto package = sasusser.myfuncs.mathfun
label = "package of math functions";
|
|
link "link-library";
link "link-library"; |
|
int split(int x "number to split")
label = "splitter function" kind=PRICING; |
|
int cashflow(double amt, double rate, int periods,
double * flows / iotype=O)
label = "cash flow function" kind=PRICING; |
|
run; |
|
proc fcmp libname=sasusser.myfuncs;
array flows[20];
a = split(32);
put a;
b = cashflow(1000, .07, 20, flows);
put b;
put flows;
run; |
Output from the SPLIT and CASHFLOW Functions
The SAS System 1
The FCMP Procedure
16
12
70 105 128.33333333 145.83333333 159.83333333 171.5 181.5 190.25 198.02777778 205.02777778
211.39141414 217.22474747 222.60936286 227.60936286 232.27602953 236.65102953 240.76867658
244.65756547 248.341776 251.841776
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.