<?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 freq missing and non-missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637527#M189494</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select age,nmiss(weight) as missing,n(weight) as non_missing
 from sashelp.class
  group by age;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 04 Apr 2020 11:38:56 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-04-04T11:38:56Z</dc:date>
    <item>
      <title>proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637197#M189420</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question 1&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;I have a dataset, ac.test, where I am trying to find the number of missing and non-missing values for the "Value" field based on each result from the "Time_on_the_record" field. Please can someone help me with the&amp;nbsp;code required so that the results can replicate the screenshot below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question 2&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Along with a proc freq, would it also be possible to create a &lt;U&gt;proc sql table&lt;/U&gt; by grouping "Value" and&amp;nbsp;"Time_on_the_record", then counting the volume of accounts for each group so that the table can be exported into Excel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: ""Time_on_the_record" and&amp;nbsp;"Value" are both numeric variables. The screenshot below is only an example of the&amp;nbsp;ac.test dataset, which has over 100,000 observations.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc freq missing and non-missing.JPG" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37738i4AA02A33AD8FF26A/image-size/large?v=v2&amp;amp;px=999" role="button" title="proc freq missing and non-missing.JPG" alt="proc freq missing and non-missing.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data = ac.test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; tables ........................... ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 13:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637197#M189420</guid>
      <dc:creator>jeremy4</dc:creator>
      <dc:date>2020-04-03T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637207#M189423</link>
      <description>&lt;P&gt;PROC FREQ has a MISSING option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=ac.test;
     tables time_on_record*value/missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Question 2: yes, I think this is possible, what is the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the PROC FREQ output can be sent to a SAS dataset, and that could then be exported to Excel.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 11:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637207#M189423</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-03T11:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637216#M189428</link>
      <description>Thanks for your reply! I've only kept those two variables in my dataset (which has over 100,000 observations) for the proc freq, but there is an error message that reads: "the results are large (58596155 bytes) and could take a long time and a large amount of system resources to add to the project". When I click "Yes" to continuing, there is a blank proc freq in the "Results".&lt;BR /&gt;&lt;BR /&gt;Is there an alternative method that is able to achieve the output shown in my screenshot?</description>
      <pubDate>Fri, 03 Apr 2020 12:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637216#M189428</guid>
      <dc:creator>jeremy4</dc:creator>
      <dc:date>2020-04-03T12:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637219#M189429</link>
      <description>&lt;P&gt;Well, I think the problem is that time_on_record is continuous, and so there will be LOTS of levels when you run PROC FREQ. I would advise some sort of "binning" of the time_on_record to reduce the number of different levels that PROC FREQ will find. Binning could be simple, such as round to the nearest integer, or round to the nearest 5, or it could be more advanced. I don't have your data, and even if I had the data I don't have the understanding of the actual problem that you have, so I can't be more specific.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637219#M189429</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-03T12:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637225#M189431</link>
      <description>Hi, I've only kept records where time_on_record = 0, 1, 2, 3, 4, 5 or 6, which leaves about 80,000 observations in the dataset. As I've been asked to individually check the number of missing and non-missing values of "Value" for each of the "time_on_record" bands, is there an alternative method to get the output shown from what I've put in the screenshot?</description>
      <pubDate>Fri, 03 Apr 2020 12:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637225#M189431</guid>
      <dc:creator>jeremy4</dc:creator>
      <dc:date>2020-04-03T12:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637230#M189432</link>
      <description>&lt;P&gt;Okay, I see the mistake. I was misled by your decision to use PROC FREQ. This is not a job for PROC FREQ, this is a job for PROC SUMMARY. Why? Because PROC FREQ would consider each value of variable VALUE to need its own column in the output table, while PROC SUMMARY will just count missings and count non-missings, resulting in just two columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=ac.test nway;
    class time_on_the_record;
    var value;
    output out=want n=n_nonmissing nmiss=n_missing;
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>Fri, 03 Apr 2020 12:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637230#M189432</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-03T12:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637527#M189494</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select age,nmiss(weight) as missing,n(weight) as non_missing
 from sashelp.class
  group by age;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Apr 2020 11:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637527#M189494</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-04-04T11:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq missing and non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637808#M189627</link>
      <description>Thanks for your help!</description>
      <pubDate>Mon, 06 Apr 2020 08:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-missing-and-non-missing-values/m-p/637808#M189627</guid>
      <dc:creator>jeremy4</dc:creator>
      <dc:date>2020-04-06T08:37:50Z</dc:date>
    </item>
  </channel>
</rss>

