proc fcmp
functions allow passing hash objects as parameters. The documentation is a little vague and it doesn't mention whether or not this ability is restricted to calls from other fcmp
functions or if it's allowed from a data step call as well.
I'm trying to define a hash in a data step and then pass that hash by reference to an fcmp
function. When I try the below code however, it's giving me: NOTE: Invalid type conversion
and I'm not sure where I'm going wrong (or if this is even possible).
option cmplib=work.funcs;
proc fcmp outlib=work.funcs.funcs;
function test(h hash);
return (0);
endsub;
run;
data _null_;
format pos best.;
if _n_ eq 1 then do;
declare hash h();
rc = h.definekey('pos');
rc = h.definedone();
call missing (pos);
end;
xx = test2(h);
put _all_;
run;
The reason I am trying to do this is because I would like to eventually have several functions that I can pass the same hash table to as a parameter.