<?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: Macro to Identify missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676449#M203969</link>
    <description>Hi. I have to use it on a daily basis for different datasets so adding this code doesn't seem a viable solution which I why was hoping for a macro instead.</description>
    <pubDate>Thu, 13 Aug 2020 11:27:25 GMT</pubDate>
    <dc:creator>adityaa9z</dc:creator>
    <dc:date>2020-08-13T11:27:25Z</dc:date>
    <item>
      <title>Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676446#M203966</link>
      <description>Hello everyone,&lt;BR /&gt;&lt;BR /&gt;Has anyone worked on a macro before that helps us identify missing values for different column in a dataset. Hoping to get an intuitive macro which tells how many and row number where values are missing. Example Name Age Sex.&lt;BR /&gt;&lt;BR /&gt;If there are 2 values missing in name, 4 in age and 5 in sex, the macro should be able to tell this info.&lt;BR /&gt;&lt;BR /&gt;Planning to use in my code once the final dataset is ready so I can just run this macro and check for missing fields, values.</description>
      <pubDate>Thu, 13 Aug 2020 11:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676446#M203966</guid>
      <dc:creator>adityaa9z</dc:creator>
      <dc:date>2020-08-13T11:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676447#M203967</link>
      <description>&lt;P&gt;No macro needed here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this code from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270201"&gt;@Watts&lt;/a&gt;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/macro-to-check-percentage-of-missing-values-in-a-dataset/m-p/676018#M203772" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/macro-to-check-percentage-of-missing-values-in-a-dataset/m-p/676018#M203772&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 11:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676447#M203967</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-13T11:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676449#M203969</link>
      <description>Hi. I have to use it on a daily basis for different datasets so adding this code doesn't seem a viable solution which I why was hoping for a macro instead.</description>
      <pubDate>Thu, 13 Aug 2020 11:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676449#M203969</guid>
      <dc:creator>adityaa9z</dc:creator>
      <dc:date>2020-08-13T11:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676461#M203976</link>
      <description>&lt;PRE&gt;%macro check_miss(dsn= , out= );
/* firstl, get variable names */
proc transpose data=&amp;amp;dsn(obs=0) out=vname;
var _all_;
run;
/* then check if variable is all missing */
proc sql noprint;
select catx(' ','nmiss(',_name_,') as',_name_) into :vnames separated by ','
from vname;
create table temp as
select &amp;amp;vnames from have;
quit;
proc transpose data=temp out=&amp;amp;out;
var _all_;
run;
%mend;




/*Test Macro*/
data have;
 set sashelp.class;
 if _n_ in ( 1 4 6) then call missing(name,age);
run;
%check_miss(dsn=have, out=want)
&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676461#M203976</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-08-13T12:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676463#M203977</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129089"&gt;@adityaa9z&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi. I have to use it on a daily basis for different datasets so adding this code doesn't seem a viable solution which I why was hoping for a macro instead.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But the code will work on every data set, regardless of variable names. How can code that works on every data set, regardless of variable names, not be viable?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676463#M203977</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-13T12:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Identify missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676548#M204017</link>
      <description>&lt;P&gt;Check out this article, it may be of some use to you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/nesug/nesug06/cc/cc12.pdf" target="_blank"&gt;https://www.lexjansen.com/nesug/nesug06/cc/cc12.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 16:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-Identify-missing-values/m-p/676548#M204017</guid>
      <dc:creator>bknitch</dc:creator>
      <dc:date>2020-08-13T16:52:09Z</dc:date>
    </item>
  </channel>
</rss>

