Previous Page | Next Page

The FCMP Procedure

Identifying the Location of Compiled Functions and Subroutines: The CMPLIB= System Option


Overview of the CMPLIB= System Option

The SAS system option CMPLIB= specifies where to look for previously compiled functions and subroutines. All procedures (including FCMP) that support the use of FCMP functions and subroutines use this system option.

Instead of specifying the LIBRARY= option on every procedure statement that supports functions and subroutines, you can use the CMPLIB= system option to set libraries that can be used by all procedures.


Syntax of the CMPLIB= System Option

The syntax for the CMPLIB= option has the following form:

OPTIONS CMPLIB = library
OPTIONS CMPLIB = (library-1, ..., library-n)
OPTIONS CMPLIB = list-1, ..., list-n

where

OPTIONS

identifies the statement as an OPTIONS statement.

library

specifies that the previously compiled libraries be linked into the program.

list

specifies a list of libraries.


Example 1: Setting the CMPLIB= System Option

The following example shows how to set the CMPLIB= system option.


Example 2: Compiling and Using Functions

In the following example, PROC FCMP compiles the SIMPLE function and stores it in the sasuser.models data set. Then the CMPLIB= system option is set, and the function is called by PROC MODEL.

proc fcmp outlib = sasuser.models.yval;
   function simple(a,b,x);
      y=a+b*x;
      return(y);
   endsub;
run;
   
options cmplib = sasuser.models nodate ls=80;

data a;
   input y @@;
   x=_n_;
   datalines;
08 06 08 10 08 10
;

proc model data=a;
   y=simple(a,b,x);
   fit y / outest=est1 out=out1;
quit;

Output from Using the SIMPLE Function with PROC MODEL

                                         The SAS System                                   1

                                       The MODEL Procedure

                                          Model Summary

                                    Model Variables         1
                                    Parameters              2
                                    Equations               1
                                    Number of Statements    1


                                      Model Variables  y
                                           Parameters  a b
                                            Equations  y


                                   The Equation to Estimate is

                                          y =  F(a, b)


                NOTE: At OLS Iteration 1 CONVERGE=0.001 Criteria Met.
                                         The SAS System                                   2

                                       The MODEL Procedure
                                     OLS Estimation Summary

                                         Data Set Options

                                         DATA=      A
                                         OUT=       OUT1
                                         OUTEST=    EST1


                                      Minimization Summary

                                Parameters Estimated            2
                                Method                      Gauss
                                Iterations                      1


                                   Final Convergence Criteria

                                   R                         0
                                   PPC                       0
                                   RPC(a)             64685.48
                                   Object             0.984333
                                   Trace(S)            1.67619
                                   Objective Value     1.11746


                                      Observations Processed

                                           Read      6
                                           Solved    6
                                         The SAS System                                    3

                                       The MODEL Procedure

                            Nonlinear OLS Summary of Residual Errors

                       DF       DF                                                        Adj
    Equation        Model    Error         SSE         MSE    Root MSE    R-Square       R-Sq

    y                   2        4      6.7048      1.6762      1.2947      0.4084     0.2605


                               Nonlinear OLS Parameter Estimates

                                                Approx                  Approx
                  Parameter       Estimate     Std Err    t Value     Pr > |t|

                  a               6.533333      1.2053       5.42       0.0056
                  b               0.514286      0.3095       1.66       0.1719


                       Number of Observations     Statistics for System

                       Used                 6    Objective         1.1175
                       Missing              0    Objective*N       6.7048
For information about PROC MODELS, see SAS/ETS User's Guide.

Previous Page | Next Page | Top of Page