<?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: Why does is missing never work? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577239#M163553</link>
    <description>&lt;P&gt;IS MISSING has no special meaning to SAS data step code.&amp;nbsp; So the error message is telling you that you did not include any operator between the variable CHOLESTEROL and the variable IS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can compare variables to the missing value which is represented by a period for numeric variables or a blank for character variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if cholesterol = . then output work.misschol;
else if cholesterol lt 200 then output work.lowchol;
else if cholesterol ge 200 then output work.highchol;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that SAS also has 27 other "special" missing numeric values which are represented by ._ and&amp;nbsp; .A&amp;nbsp; to .Z which are distinct and different than regular missing value.&amp;nbsp; So it could be safer to use the MISSING() function to test if a variable is missing or not.&amp;nbsp; The MISSING() function works for both numeric and character variables.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jul 2019 15:03:27 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-28T15:03:27Z</dc:date>
    <item>
      <title>Why does is missing never work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577232#M163549</link>
      <description>&lt;P&gt;I have always received an error when I use "Is Missing". For example in the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.lowchol work.highchol work.misschol;&lt;BR /&gt;set sashelp.heart;&lt;BR /&gt;if cholesterol is missing then output work.misschol;&lt;BR /&gt;else if cholesterol lt 200 then output work.lowchol;&lt;BR /&gt;else if cholesterol ge 200 then output work.highchol;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;/P&gt;&lt;P&gt;28 if cholesterol is missing then output work.misschol;&lt;BR /&gt;__&lt;BR /&gt;388&lt;BR /&gt;76&lt;BR /&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone let me know why this happens? or if i am making a mistake here?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 14:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577232#M163549</guid>
      <dc:creator>primukh26</dc:creator>
      <dc:date>2019-07-28T14:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why does is missing never work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577234#M163550</link>
      <description>&lt;PRE&gt;if cholesterol is missing then output work.misschol;&lt;/PRE&gt;
&lt;P&gt;Use MISSING as a function like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if missing(cholesterol) then output work.misschol;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Jul 2019 14:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577234#M163550</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-07-28T14:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why does is missing never work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577236#M163551</link>
      <description>&lt;P&gt;Thank you this removed all errors from the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.lowchol work.highchol work.misschol;&lt;BR /&gt;set sashelp.heart;&lt;BR /&gt;if missing(cholesterol) then output work.misschol;&lt;BR /&gt;else if cholesterol lt 200 then output work.lowchol;&lt;BR /&gt;else if cholesterol ge 200 then output work.highchol;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 14:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577236#M163551</guid>
      <dc:creator>primukh26</dc:creator>
      <dc:date>2019-07-28T14:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does is missing never work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577238#M163552</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277218"&gt;@primukh26&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use WHERE to make "is missing" work like-&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Create sample input data*/
data have;
do i=1 to 5;
do cholesterol =.,0 to 300;
output;
end;
end;
run;

/*Test where cholesterol is missing*/
data work.lowchol(where=(0&amp;lt;=cholesterol&amp;lt;= 200)) 
work.highchol(where=(cholesterol gt 200)) 
work.misschol(where=(cholesterol is missing));
set have;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 15:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577238#M163552</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-28T15:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does is missing never work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577239#M163553</link>
      <description>&lt;P&gt;IS MISSING has no special meaning to SAS data step code.&amp;nbsp; So the error message is telling you that you did not include any operator between the variable CHOLESTEROL and the variable IS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can compare variables to the missing value which is represented by a period for numeric variables or a blank for character variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if cholesterol = . then output work.misschol;
else if cholesterol lt 200 then output work.lowchol;
else if cholesterol ge 200 then output work.highchol;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that SAS also has 27 other "special" missing numeric values which are represented by ._ and&amp;nbsp; .A&amp;nbsp; to .Z which are distinct and different than regular missing value.&amp;nbsp; So it could be safer to use the MISSING() function to test if a variable is missing or not.&amp;nbsp; The MISSING() function works for both numeric and character variables.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 15:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-is-missing-never-work/m-p/577239#M163553</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-28T15:03:27Z</dc:date>
    </item>
  </channel>
</rss>

