I should disclaim all of this by saying that I'm fairly new to SAS programming, so I could be missing something obvious, but I'm having a strange problem with proc fcmp on my SAS 9.1.3 SP 4 server. I'm trying to run the following program:
proc fcmp outlib=work.funcs.comn;
function adw (Theo, Actual, Days);
if Actual > (Theo*0.4) then
OutAdw = adw(100, 75, 10);
However, I get the error "The function ADW is unknown, or cannot be accessed. From what I read, I thought the options cmplib=work.funcs; would solve that. Can anyone tell me what I'm doing wrong? Here's the full log, just for good measure...
1 proc fcmp outlib=work.funcs.comn;
2 function adw (Theo, Actual, Days);
3 if Actual > (Theo*0.4) then
NOTE: Function adw saved to catalog work.funcs.comn.
NOTE: PROCEDURE FCMP used (Total process time):
real time 0.26 seconds
cpu time 0.21 seconds
10 options cmplib=work.funcs;
12 data _null_;
13 OutAdw = adw(100, 75, 10);
ERROR 68-185: The function ADW is unknown, or cannot be accessed.
15 put OutAdw=;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
The SAS Function Compiler (FCMP) Procedure allows users to create, test, and store SAS functions and subroutines for use by other SAS procedures.
The following SAS procedures allow the use of the functions and subroutines created by FCMP:
• RISK DIMENSIONS
In SAS 9.2, FCMP routines can be called from the DATA step like any other SAS function.
D'oh! I'd seen some stuff saying that FCMP worked in SAS 9.2, but nothing that explicitly said it wouldn't work in 9.1.3. And since it took the proc without complaining, I figured I was doing something wrong in the code.
That makes more sense. Thanks for shedding some light on that for me!