Help using Base SAS procedures

proc fcmp confusion

Reply
N/A
Posts: 0

proc fcmp confusion

Hi all,

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
return(Actual/Days);
else
return((Theo*0.4)/Days);
endsub;
quit;

options cmplib=work.funcs;

data _null_;
OutAdw = adw(100, 75, 10);
put OutAdw=;
run;

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
4 return(Actual/Days);
5 else
6 return((Theo*0.4)/Days);
7 endsub;
8 quit;

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


9
10 options cmplib=work.funcs;
11
12 data _null_;
13 OutAdw = adw(100, 75, 10);
---
68
ERROR 68-185: The function ADW is unknown, or cannot be accessed.

14
15 put OutAdw=;
16 run;

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
PROC Star
Posts: 1,564

upgrade time!

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:
• CALIS
• COMPILE
• DISTANCE
• GA
• GENMOD
• MODEL
• NLIN
• NLMIXED
• NLP
• PHREG
• RISK DIMENSIONS
• ROBUSTREG
• SIMILAR
• SYLK

In SAS 9.2, FCMP routines can be called from the DATA step like any other SAS function.
N/A
Posts: 0

Re: upgrade time!

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!
Ask a Question
Discussion stats
  • 2 replies
  • 268 views
  • 0 likes
  • 2 in conversation