Help using Base SAS procedures

Proc FCMP - how to check variables are initialized?

Reply
New Contributor
Posts: 2

Proc FCMP - how to check variables are initialized?

Hi,

I have just started using proc FCMP and I am interested if it is possible to have the functions perform some basic checks to make them robust.

For instance, if I supply a variable that does not exist in the PDV to a regular base SAS function such as int(x), or even just y = x where x is not in the PDV, I get the message NOTE:...uninitialized... but if I create a new function in proc FCMP I can't seem to recreate this behaviour.

Using the function in a where clause errors just as the SAS function would, so there it is ok.


Can anyone shed any light on why the uninitialized note would not be produced? Or better yet if there is a way of producing this note in a user defined function.
Regular Contributor
Posts: 241

Re: Proc FCMP - how to check variables are initialized?

Posted in reply to Proc_explode
Yeah, this is funny. I don't think there is anything us, users, can do about it, though. I suspect that by the time your fcmp function executes, it has already received a missing value and that's it, since the arguments are passed as values by default. As far as I know, that is. :-)
[pre]
proc fcmp outlib=work.func.test;
function isOne(x);
return (x=1);
endsub;
quit;

%let cmplib = %sysfunc(getoption(cmplib));
options cmplib = (&cmplib work.func);
data _null_;
ans = isOne(v);
put ans=;
run;
options cmplib = (&cmplib);
/* expected an "uninitialized" NOTE for the variable v, but no log messages at all */
[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 133 views
  • 0 likes
  • 2 in conversation