<?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 Tabulate Help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61032#M17311</link>
    <description>If you only need a report, consider using PROC REPORT, with ACROSS.&lt;BR /&gt;
&lt;BR /&gt;
If you need to generate a SAS data member as shown, consider using PROC TRANSPOSE.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 05 Aug 2010 18:50:14 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-08-05T18:50:14Z</dc:date>
    <item>
      <title>Proc Tabulate Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61031#M17310</link>
      <description>Hi Colleagues;&lt;BR /&gt;
&lt;BR /&gt;
I have a material deprivation data set having over 18,000 observations. The two variables of interest are like below. &lt;BR /&gt;
&lt;BR /&gt;
Data Deprivation;&lt;BR /&gt;
Input CDN DQ;&lt;BR /&gt;
Cards;&lt;BR /&gt;
1350	2	&lt;BR /&gt;
2840	1	&lt;BR /&gt;
2745	3	&lt;BR /&gt;
9358	4	&lt;BR /&gt;
6570	2	&lt;BR /&gt;
1241	1	&lt;BR /&gt;
8759	5	&lt;BR /&gt;
3570	5	&lt;BR /&gt;
&lt;BR /&gt;
;&lt;BR /&gt;
Run;&lt;BR /&gt;
&lt;BR /&gt;
CDN = Census Division Number&lt;BR /&gt;
DQ = Deprivation Quintile&lt;BR /&gt;
&lt;BR /&gt;
Question&lt;BR /&gt;
I need to categorize CDNs by DQs. In other words, I need to identify what are the CDAs falling under each deprivation quintile. For instance, the output should be like this.&lt;BR /&gt;
 &lt;BR /&gt;
DQ	CDN&lt;BR /&gt;
1	2840, 1241&lt;BR /&gt;
2	1350, 6570&lt;BR /&gt;
3	2745&lt;BR /&gt;
4	9358&lt;BR /&gt;
5	8759, 3570	&lt;BR /&gt;
 &lt;BR /&gt;
I searched literature on “Proc Tabulate” for over 8 hours but could not find. &lt;BR /&gt;
&lt;BR /&gt;
I wonder if anyone could help me to write the SAS code.&lt;BR /&gt;
&lt;BR /&gt;
Thank you&lt;BR /&gt;
Mirisage</description>
      <pubDate>Thu, 05 Aug 2010 18:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61031#M17310</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2010-08-05T18:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61032#M17311</link>
      <description>If you only need a report, consider using PROC REPORT, with ACROSS.&lt;BR /&gt;
&lt;BR /&gt;
If you need to generate a SAS data member as shown, consider using PROC TRANSPOSE.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 05 Aug 2010 18:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61032#M17311</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-05T18:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61033#M17312</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Scott. It is not clear whether you want a DATASET (with a single obs for every unique value of DQ) or whether you want a REPORT. The difference is that for a DATASET, you would probably have variable names such as CDN1, CDN2, CDN3, etc for every unique value of DQ. A PROC PRINT of such a dataset might look like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Obs    DQ    cdn1    cdn2&lt;BR /&gt;
 1      1    2840    1241&lt;BR /&gt;
 2      2    1350    6570&lt;BR /&gt;
 3      3    2745       .&lt;BR /&gt;
 4      4    9358       .&lt;BR /&gt;
 5      5    8759    3570&lt;BR /&gt;
    &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                               &lt;BR /&gt;
In a report, as with PROC TABULATE or PROC REPORT on the other hand, the unique values of CDN would each become a column header and what would be inside the cells would be the calculated count for each crossing of CDN and DQ something like this (shown in LISTING output):&lt;BR /&gt;
[pre]&lt;BR /&gt;
+--------------------------------------------------------------------+&lt;BR /&gt;
|     |                          CDN                          |      |&lt;BR /&gt;
|     +-------------------------------------------------------+      |&lt;BR /&gt;
|     | 1241 | 1350 | 2745 | 2840 | 3570 | 6570 | 8759 | 9358 |Total |&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|DQ   |      |      |      |      |      |      |      |      |      |&lt;BR /&gt;
+-----+      |      |      |      |      |      |      |      |      |&lt;BR /&gt;
|1    |     1|     0|     0|     1|     0|     0|     0|     0|     2|&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|2    |     0|     1|     0|     0|     0|     1|     0|     0|     2|&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|3    |     0|     0|     1|     0|     0|     0|     0|     0|     1|&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|4    |     0|     0|     0|     0|     0|     0|     0|     1|     1|&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|5    |     0|     0|     0|     0|     1|     0|     1|     0|     2|&lt;BR /&gt;
+-----+------+------+------+------+------+------+------+------+------+&lt;BR /&gt;
|Total|     1|     1|     1|     1|     1|     1|     1|     1|     8|&lt;BR /&gt;
+--------------------------------------------------------------------+&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
  If you want a dataset, then Scott's suggestion to use PROC TRANSPOSE is where you should look&lt;BR /&gt;
&lt;BR /&gt;
  If you want a report that can be routed to an HTML, RTF or PDF file, then I'm surprised that you didn't find at least this paper entitled, "Anyone Can Learn Proc Tabulate" &lt;A href="http://www2.sas.com/proceedings/sugi27/p060-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p060-27.pdf&lt;/A&gt; ... especially with 8 hours of of searching. I found it with the Google search string:&lt;BR /&gt;
SAS PROC TABULATE beginner&lt;BR /&gt;
&lt;BR /&gt;
If you decide you want PROC TABULATE, then the above paper, plus these will be a place to start:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2007/230-2007.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2007/230-2007.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi28/071-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/071-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 05 Aug 2010 19:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61033#M17312</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-08-05T19:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61034#M17313</link>
      <description>Hi Scott and Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
This is wealth of knowledge.And the links for more resources are also useful.&lt;BR /&gt;
&lt;BR /&gt;
Thanks both of you.&lt;BR /&gt;
&lt;BR /&gt;
I am customizing this knowledge for my specific question and would come back if I get stuck.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again!&lt;BR /&gt;
&lt;BR /&gt;
Mirisage&lt;BR /&gt;
&lt;BR /&gt;
I am</description>
      <pubDate>Thu, 05 Aug 2010 19:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Help/m-p/61034#M17313</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2010-08-05T19:47:54Z</dc:date>
    </item>
  </channel>
</rss>

