<?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 Proc FREQ confuses MISSING and OTHER formated categories in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150768#M11628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a lot of fumbling around, I came to the following guess: when building a table on a formatted variable, Proc Freq confuses all values that format the same as a missing value to missing values. The following example illustrates this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format; value test low-0 = "LOW" OTHER = "HIGH"; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test; output; do x = -3 to 3; output; end; format x test.; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc freq data=test; table x; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice the absence of the &lt;STRONG&gt;HIGH&lt;/STRONG&gt; category in Freq output. Remove the first &lt;STRONG&gt;OUTPUT&lt;/STRONG&gt; statement in the datastep (thereby removing the missing &lt;STRONG&gt;x&lt;/STRONG&gt; value from the dataset) and the &lt;STRONG&gt;HIGH&lt;/STRONG&gt; category reappears in Freq output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Had anybody else noticed this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Mar 2014 18:46:39 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-03-20T18:46:39Z</dc:date>
    <item>
      <title>Proc FREQ confuses MISSING and OTHER formated categories</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150768#M11628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a lot of fumbling around, I came to the following guess: when building a table on a formatted variable, Proc Freq confuses all values that format the same as a missing value to missing values. The following example illustrates this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format; value test low-0 = "LOW" OTHER = "HIGH"; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test; output; do x = -3 to 3; output; end; format x test.; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc freq data=test; table x; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice the absence of the &lt;STRONG&gt;HIGH&lt;/STRONG&gt; category in Freq output. Remove the first &lt;STRONG&gt;OUTPUT&lt;/STRONG&gt; statement in the datastep (thereby removing the missing &lt;STRONG&gt;x&lt;/STRONG&gt; value from the dataset) and the &lt;STRONG&gt;HIGH&lt;/STRONG&gt; category reappears in Freq output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Had anybody else noticed this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 18:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150768#M11628</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-03-20T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FREQ confuses MISSING and OTHER formated categories</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150769#M11629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not the same but a similar oddity if you run it through Proc Summary the missing turns into a -3.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc summary data=test nway;&lt;/P&gt;&lt;P&gt;class x;&lt;/P&gt;&lt;P&gt;var x;&lt;/P&gt;&lt;P&gt;output out=testsum n=count;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;format x f4.;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc summary returns the smallest non-missing value as the value of the formatted class variable.&lt;/P&gt;&lt;P&gt;Which is why my custom formats pretty much always have a missing category if I use the Other option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 19:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150769#M11629</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-03-20T19:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FREQ confuses MISSING and OTHER formated categories</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150770#M11630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When PROC FREQ counts all the HIGH and LOW values, it only stores one numeric value for each category.&amp;nbsp; It stores the lowest value that actually appears in the data set.&amp;nbsp; So here are some results I would expect from your test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If PROC FREQ were to create an output data set, the actual unformatted values for X would be missing and -3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If you were to add the MISSING option when creating the table, HIGH would appear first and LOW would appear second because missing is less than -3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. If&amp;nbsp; you were to remove the first OUTPUT statement, but still include the MISSING option, the order would switch and LOW would appear before HIGH because -3 is less than 1.&lt;/P&gt;&lt;P&gt;In every case, though, the unformatted values in the output data set would clarify what PROC FREQ is doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 19:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150770#M11630</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-03-20T19:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FREQ confuses MISSING and OTHER formated categories</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150771#M11631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A __default_attr="260198" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; and &lt;A __default_attr="5253" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/" modifiedtitle="true" title="Astounding,"&gt;&lt;/A&gt; you help me understand what's going on. There is some logic in storing the lowest value represented in a category. The logic fails when it extends to missing values because the special treatment given almost everywhere to missing values is de facto extended to non-missing values. This can be very confusing; it was for me.&lt;/P&gt;&lt;P&gt;I will try to always remember Ballardw's suggestion for always including an explicit missing category when defining user formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish I had read this in SAS doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 20:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-FREQ-confuses-MISSING-and-OTHER-formated-categories/m-p/150771#M11631</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-03-20T20:55:32Z</dc:date>
    </item>
  </channel>
</rss>

