<?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: Finding empty values and stopping after finding more than the threshold in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416772#M102353</link>
    <description>You have to provide more details on the code to be stopped after to many missing values haven been found. Afaik you can't do this in process SQL or any other procedure. In a data-step just retain a counter variable.</description>
    <pubDate>Tue, 28 Nov 2017 17:19:23 GMT</pubDate>
    <dc:creator>error_prone</dc:creator>
    <dc:date>2017-11-28T17:19:23Z</dc:date>
    <item>
      <title>Finding empty values and stopping after finding more than the threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416761#M102350</link>
      <description>&lt;P&gt;Hello, I have a table with about 15M obs and I wanna make sure that one variable doesn't have too many missing values. I would like the code to stop after a treshold of about 5k missing values, how do I do that? The process takes about 5,5 min. right now if it reads all&amp;nbsp; the observations. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint stimer;
	SELECT
		count(*)
	FROM
		have(keep= variable)
	WHERE
		variable is null
	;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416761#M102350</guid>
      <dc:creator>x2PSx</dc:creator>
      <dc:date>2017-11-28T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding empty values and stopping after finding more than the threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416771#M102352</link>
      <description>&lt;P&gt;SQL doesn't operate that way. You need at data step and a counter with a&amp;nbsp;STOP to end the data step.&lt;/P&gt;
&lt;P&gt;You would count missing but here's another way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be easier to just run PROC FREQ with a missing format and see the total missing in the output. 15 million rows won't take that long to process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
set sashelp.class;
retain sum_age;
sum_age = sum(age, sum_age);

if sum_age &amp;gt; 100 then stop;
run;
proc print data=demo;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's an example of how to do the proc freq on the full data set at once and see the numbers in a formatted table:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_blank"&gt;https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416771#M102352</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-28T17:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Finding empty values and stopping after finding more than the threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416772#M102353</link>
      <description>You have to provide more details on the code to be stopped after to many missing values haven been found. Afaik you can't do this in process SQL or any other procedure. In a data-step just retain a counter variable.</description>
      <pubDate>Tue, 28 Nov 2017 17:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-empty-values-and-stopping-after-finding-more-than-the/m-p/416772#M102353</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-11-28T17:19:23Z</dc:date>
    </item>
  </channel>
</rss>

