Using PROC FCMP

Overview

The FCMP procedure uses the SAS language compiler to create user-defined functions. The compiler subsystem generates machine language code for the computer on which SAS is running.
You can use the functions and subroutines that you create in PROC FCMP with the DATA step, the WHERE statement, the Output Delivery System (ODS), and with the following procedures:
PROC CALIS PROC OPTLSO
PROC GA PROC QUANTREG
PROC GENMOD PROC REPORT COMPUTE blocks
PROC GLIMMIX SAS Risk Dimensions procedures
PROC MCMC PROC SEVERITY
PROC MODEL PROC SIMILARITY
PROC NLIN PROC SQL (functions with array arguments are not supported)
PROC NLMIXED PROC SURVEYPHREG
PROC NLP PROC VARMAX

Writing a PROC FCMP Step

The following syntax is for PROC FCMP:
General form for a basic PROC FCMP step to create and save a function.
PROC FCMP OUTLIB= libref.data-set.package;
Function function-name(argument-1<$>,...,argument-n<$><length>;
programming statements;
Return (expression);
ENDSUB;
QUIT;
Here is an explanation of the syntax:
PROC FCMP
creates, tests, and stores SAS functions for use by other SAS procedures and the DATA step.
ENDSUB
ends the function’s declaration.
FUNCTION
begins the definition of the function. The FUNCTION definition ends with the ENDSUB statement.
programming statements
are a series of DATA step statements that describe the function’s actions.
OUTLIB
specifies the package where routines are stored.
RETURN
specifies the value that is returned by the function.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.21.47