<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc FCMP - how to check variables are initialized? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-FCMP-how-to-check-variables-are-initialized/m-p/74120#M21463</link>
    <description>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. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
[pre]&lt;BR /&gt;
   proc fcmp outlib=work.func.test;&lt;BR /&gt;
     function isOne(x);&lt;BR /&gt;
       return (x=1);&lt;BR /&gt;
     endsub;&lt;BR /&gt;
   quit;&lt;BR /&gt;
&lt;BR /&gt;
   %let cmplib = %sysfunc(getoption(cmplib));&lt;BR /&gt;
   options cmplib = (&amp;amp;cmplib work.func);&lt;BR /&gt;
   data _null_;&lt;BR /&gt;
     ans = isOne(v);&lt;BR /&gt;
     put ans=;&lt;BR /&gt;
   run;&lt;BR /&gt;
   options cmplib = (&amp;amp;cmplib);&lt;BR /&gt;
   /* expected an "uninitialized" NOTE for the variable v, but no log messages at all */&lt;BR /&gt;
[/pre]</description>
    <pubDate>Wed, 22 Sep 2010 20:19:05 GMT</pubDate>
    <dc:creator>chang_y_chung_hotmail_com</dc:creator>
    <dc:date>2010-09-22T20:19:05Z</dc:date>
    <item>
      <title>Proc FCMP - how to check variables are initialized?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-FCMP-how-to-check-variables-are-initialized/m-p/74119#M21462</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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 &lt;I&gt;NOTE:...uninitialized...&lt;/I&gt; but if I create a new function in proc FCMP I can't seem to recreate this behaviour.&lt;BR /&gt;
&lt;BR /&gt;
Using the function in a where clause errors just as the SAS function would, so there it is ok.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Can anyone shed any light on why the &lt;I&gt;uninitialized&lt;/I&gt; note would not be produced? Or better yet if there is a way of producing this note in a user defined function.</description>
      <pubDate>Wed, 22 Sep 2010 19:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-FCMP-how-to-check-variables-are-initialized/m-p/74119#M21462</guid>
      <dc:creator>Proc_explode</dc:creator>
      <dc:date>2010-09-22T19:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FCMP - how to check variables are initialized?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-FCMP-how-to-check-variables-are-initialized/m-p/74120#M21463</link>
      <description>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. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
[pre]&lt;BR /&gt;
   proc fcmp outlib=work.func.test;&lt;BR /&gt;
     function isOne(x);&lt;BR /&gt;
       return (x=1);&lt;BR /&gt;
     endsub;&lt;BR /&gt;
   quit;&lt;BR /&gt;
&lt;BR /&gt;
   %let cmplib = %sysfunc(getoption(cmplib));&lt;BR /&gt;
   options cmplib = (&amp;amp;cmplib work.func);&lt;BR /&gt;
   data _null_;&lt;BR /&gt;
     ans = isOne(v);&lt;BR /&gt;
     put ans=;&lt;BR /&gt;
   run;&lt;BR /&gt;
   options cmplib = (&amp;amp;cmplib);&lt;BR /&gt;
   /* expected an "uninitialized" NOTE for the variable v, but no log messages at all */&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 22 Sep 2010 20:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-FCMP-how-to-check-variables-are-initialized/m-p/74120#M21463</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-09-22T20:19:05Z</dc:date>
    </item>
  </channel>
</rss>

