<?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: need a macro that checks missing values in the input file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67486#M14604</link>
    <description>just been trying out that suggestion I made and find I would like to update it&lt;BR /&gt;
     cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;&lt;BR /&gt;
returns 1 if the only missing value is in the cols_missing  result !&lt;BR /&gt;
So now I'm suggesting[pre]     cols_missing = 0 ; * ensure this is not missing ;&lt;BR /&gt;
     cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;[pre]&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
    <pubDate>Sat, 28 Aug 2010 18:05:23 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-08-28T18:05:23Z</dc:date>
    <item>
      <title>need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67482#M14600</link>
      <description>hi is there any  macro that checks the missing vlaues in the sas file for n number of variables and if found it sends a mail...</description>
      <pubDate>Fri, 27 Aug 2010 11:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67482#M14600</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-27T11:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67483#M14601</link>
      <description>in "filename email" online help, you'll find an example, &lt;BR /&gt;
The easy way to count columns missing in one observation (old forum discussion) &lt;A href="http://support.sas.com/forums/thread.jspa?messageID=31443#31443" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=31443#31443&lt;/A&gt; &lt;BR /&gt;
or similarly[pre]  cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;[/pre] but that cmiss() is a new function in SAS9.2&lt;BR /&gt;
Do you need a SAS91 alternative?</description>
      <pubDate>Fri, 27 Aug 2010 14:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67483#M14601</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-08-27T14:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67484#M14602</link>
      <description>Regarding conditional EMAILs, there is no pre-coded "macro" to perform the process, however this topic has been discussed in the forum - suggest a search of the forums.&lt;BR /&gt;
&lt;BR /&gt;
Also, the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt; website has SAS-hosted and supplemental technical / conference reference material on this topic/post.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
conditional email site:sas.com</description>
      <pubDate>Fri, 27 Aug 2010 16:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67484#M14602</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-27T16:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67485#M14603</link>
      <description>If you can use Peter's suggested code you can easily incorporate it within the examples shown at: &lt;A href="http://www2.sas.com/proceedings/sugi29/126-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/126-29.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Sat, 28 Aug 2010 13:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67485#M14603</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-08-28T13:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67486#M14604</link>
      <description>just been trying out that suggestion I made and find I would like to update it&lt;BR /&gt;
     cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;&lt;BR /&gt;
returns 1 if the only missing value is in the cols_missing  result !&lt;BR /&gt;
So now I'm suggesting[pre]     cols_missing = 0 ; * ensure this is not missing ;&lt;BR /&gt;
     cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;[pre]&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Sat, 28 Aug 2010 18:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67486#M14604</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-08-28T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67487#M14605</link>
      <description>cols_missing will be part of the _NUMERIC_ list.  Is that ok?&lt;BR /&gt;
&lt;BR /&gt;
It may be "safer" to create two arrays &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
   set ...;&lt;BR /&gt;
   array _c&lt;LI&gt; _character_;&lt;BR /&gt;
   array _n&lt;/LI&gt;&lt;LI&gt; _numeric_; &lt;BR /&gt;
   cols_missing=0;&lt;BR /&gt;
   cols_missing = nmiss(of _n&lt;/LI&gt;&lt;LI&gt;,1 ) + cmiss(of _c&lt;/LI&gt;&lt;LI&gt; 'a' ); &lt;BR /&gt;
[/pre]&lt;/LI&gt;</description>
      <pubDate>Sat, 28 Aug 2010 19:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67487#M14605</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-08-28T19:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67488#M14606</link>
      <description>Why is it safer if you are still using _character_ and _numeric_ to define the arrays? Would the array definition create syntax error when there are no character variables?&lt;BR /&gt;
I tested my code and that is why the initialisation of col&lt;BR /&gt;
_missing to zero was proposed.</description>
      <pubDate>Sun, 29 Aug 2010 21:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67488#M14606</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-08-29T21:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: need a macro that checks missing values in the input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67489#M14607</link>
      <description>Yes I realize now that you have corrected the bug with the initialization of COL_MISSING.  &lt;BR /&gt;
&lt;BR /&gt;
The safer part I was referring to has to do with where the program uses _NUMERIC_, just after SET before anything else, like defining other numeric variables happen.  I often use [pre]IF 0 THEN SET;[/pre] if my program to isolate the variables when creating the ARRAYS.&lt;BR /&gt;
&lt;BR /&gt;
It is a common mistake to see _NUMERIC_ used on the left side of an expression as you did, we don't usually remember that the variable on the left COL_MISSING is also included in the list described by _NUMERIC_.&lt;BR /&gt;
&lt;BR /&gt;
For me creating the array just after the set as in my example frees me of the having to remember that the variables in _NUMERIC_ may change as I write new statements.</description>
      <pubDate>Mon, 30 Aug 2010 11:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-a-macro-that-checks-missing-values-in-the-input-file/m-p/67489#M14607</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-08-30T11:45:17Z</dc:date>
    </item>
  </channel>
</rss>

