BookmarkSubscribeRSS Feed
Proc_explode
Calcite | Level 5
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.
1 REPLY 1
chang_y_chung_hotmail_com
Obsidian | Level 7
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]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 896 views
  • 1 like
  • 2 in conversation