<?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 SQL - Display all cateorgies in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285268#M58278</link>
    <description>&lt;P&gt;Not an elegant solution but create a base data set with the values for the variable and a count of 0.&lt;/P&gt;
&lt;P&gt;Create a dataset from your counting code.&lt;/P&gt;
&lt;P&gt;The create a report data set by updating the value in the base set from the counting set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for a report I would use &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s Proc tabulate approach, especially if I'm doing this very often.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2016 15:58:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-07-18T15:58:11Z</dc:date>
    <item>
      <title>Proc SQL - Display all cateorgies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285237#M58262</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&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;PROC SQL;
 SELECT Neighborhoods, COUNT(childid) AS NewEnroll_ByCou_YTD
  FROM counts
  where '01jan2016'd &amp;lt;= dateeval &amp;lt;= &amp;amp;Marco_tdate
  group by Neighborhoods;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Gives me the output below. However, there are 35 other cateorgies that are associated with this variable. Is there a way to have them all listed? So in total it would be 42 rows, All the neighborhoods listed and zeros?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Neighborhoods NewEnroll_ByCou_YTD &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Central Bronx&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bronx Park and Fordham&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;High Bridge and Morrisania&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Hunts Point and Mott Haven&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Central Harlem&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Chelsea and Clinton&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;East Harlem&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;42&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Jul 2016 14:19:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285237#M58262</guid>
      <dc:creator>hwangnyc</dc:creator>
      <dc:date>2016-07-18T14:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Display all cateorgies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285242#M58266</link>
      <description>&lt;P&gt;Not within Proc SQL, easily.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look up PRELOADFMT and proc tabulate. You can also try proc freq with sparse option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 14:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285242#M58266</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-18T14:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Display all cateorgies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285253#M58270</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With proc sql, maybe sometghing like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
 SELECT Neighborhoods, COUNT(childid) AS NewEnroll_ByCou_YTD
  FROM counts
  where '01jan2016'd &amp;lt;= dateeval &amp;lt;= &amp;amp;Marco_tdate
  group by Neighborhoods

UNION

SELECT DISTINCT Neighborhoods, 0 AS  NewEnroll_ByCou_YTD
  FROM counts
WHERE dateeval&amp;lt;'01jan2016'd OR dateeval&amp;gt;&amp;amp;Marco_tdate;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Jul 2016 15:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285253#M58270</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2016-07-18T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Display all cateorgies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285268#M58278</link>
      <description>&lt;P&gt;Not an elegant solution but create a base data set with the values for the variable and a count of 0.&lt;/P&gt;
&lt;P&gt;Create a dataset from your counting code.&lt;/P&gt;
&lt;P&gt;The create a report data set by updating the value in the base set from the counting set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for a report I would use &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s Proc tabulate approach, especially if I'm doing this very often.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 15:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285268#M58278</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-18T15:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Display all cateorgies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285440#M58358</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data levels;
sex='F';output;
sex='M';output;
sex='X';output;
run;

data class;
 set sashelp.class(in=ina) levels;
 w=ina;
run;

proc freq data=class;
table sex;
weight w/zeros;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4129i93EA57FEE7535F1F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 05:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Display-all-cateorgies/m-p/285440#M58358</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-19T05:49:38Z</dc:date>
    </item>
  </channel>
</rss>

