While creating the user defined functions by using PROC FCMP, we have to mention the location where the created function should be saved. It shoud be in the form of three level. First level indicates library name, second level indicated dataset name and third level indicated package name.
Within the library, each function or subroutines is associated with a "Package".
Package is a group of functions and subroutines.
Function library can contain multiple packages.
Example1;
/* Declaring the function */
proc fcmp outlib=sasuser.study.demo;
function study_day(intervention_date, event_date);
n=event_date-intervention_date;
if n <= 0 then
n=n+1;
return (n);
endsub;
Run;
options cmplib=sasuser.funcs;
data Ae;
start = '15Feb2006'd;
today = '27Mar2006'd;
sd = study_day(start, today);
run
... View more