PROC FCMP requires a three-level argument when specifying the output dataset in which the compiled function/subroutine should be stored. But when using those compiled functions SAS requires a two-level argument for the global option CMPLIB.
The documentation says:
Note: Subroutine and function names must be unique within a package. However, different packages can have subroutines and functions with the same names. To select a specific subroutine when there is ambiguity, prefix the subroutine name with the package name and a period (.) For example, to get the MthFncs version of inverse, use MthFncs.inverse
But I haven't been able to reproduce that behaviour. When doing:
proc fcmp outlib=work.functions.pkg1;
function test(var1, var2);
return (var1+var2);
endsub;
run;
proc fcmp outlib=work.functions.pkg2;
function test(var1, var2);
return (var1*var2);
endsub;
run;
option cmplib=work.functions;
data _null_;
a=test(3,3);
b=pkg1.test(3,3);
c=pkg2.test(3,3);
put a= b= c=;
run;
The program crashes and says:
ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase.
31 b=pkg1.test(3,3);
_________
557
ERROR 557-185: Variable pkg1 is not an object.
Isn't this the way packages are meant to be used? Am I doing something wrong? Looks like yes :) but I can't see what. Thanks!