Hi, Not sure where to post this (recommendations welcome), but be aware of a bug in SAS when using proc fcmp functions in proc sql - the variable scopes are not resolved correctly and assignments to arguments within the fcmp functions are actually made to the arguments that are passed (despite a warning in the log stating that they're not). Here's a minimal reproducible example: proc fcmp outlib=work.functions.mre;
function get_a_value(arg $);
arg = "FromFcmp";
return(0);
endsub;
run;
option CMPLIB=work.functions;
proc sql;
create table example as select x, get_a_value(x) as y from (select "From Sql" as x from dictionary.libnames);
quit; Within the created data set (work.example) the value of x is "FromFcmp". The workaround is to assign the arguments of functions to local variables and manipulate those.
... View more