<?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 tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922319#M363198</link>
    <description>&lt;P&gt;I have the following data&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;County&lt;/TD&gt;
&lt;TD width="25%"&gt;Year&lt;/TD&gt;
&lt;TD width="25%"&gt;Sex&lt;/TD&gt;
&lt;TD width="25%"&gt;Population&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;545131&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;64465&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2014&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;6543513&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2014&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;6546551&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;B&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;65651&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;B&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;6546541&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code:&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.census3 format=5.;&lt;BR /&gt;format sex $sex.;&lt;BR /&gt;class sex county year pop / missing preloadfmt;&lt;BR /&gt;tables county=''*sex='', year='' /printmiss box='Sex' rts=20;&lt;BR /&gt;keylabel n=' ' all='Total';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mary_mcneill_0-1711751951913.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95036i50577A097C5A0770/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mary_mcneill_0-1711751951913.png" alt="mary_mcneill_0-1711751951913.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is only counting county by sex for each year and I want the population data for county by sex for each year. How do I modify the code to get the population data for each sex by year in the table? Pease help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Fri, 29 Mar 2024 22:40:21 GMT</pubDate>
    <dc:creator>mary_mcneill</dc:creator>
    <dc:date>2024-03-29T22:40:21Z</dc:date>
    <item>
      <title>proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922319#M363198</link>
      <description>&lt;P&gt;I have the following data&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;County&lt;/TD&gt;
&lt;TD width="25%"&gt;Year&lt;/TD&gt;
&lt;TD width="25%"&gt;Sex&lt;/TD&gt;
&lt;TD width="25%"&gt;Population&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;545131&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;64465&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2014&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;6543513&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;2014&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;6546551&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;B&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Male&lt;/TD&gt;
&lt;TD width="25%"&gt;65651&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;B&lt;/TD&gt;
&lt;TD width="25%"&gt;2013&lt;/TD&gt;
&lt;TD width="25%"&gt;Female&lt;/TD&gt;
&lt;TD width="25%"&gt;6546541&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code:&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.census3 format=5.;&lt;BR /&gt;format sex $sex.;&lt;BR /&gt;class sex county year pop / missing preloadfmt;&lt;BR /&gt;tables county=''*sex='', year='' /printmiss box='Sex' rts=20;&lt;BR /&gt;keylabel n=' ' all='Total';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mary_mcneill_0-1711751951913.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95036i50577A097C5A0770/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mary_mcneill_0-1711751951913.png" alt="mary_mcneill_0-1711751951913.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is only counting county by sex for each year and I want the population data for county by sex for each year. How do I modify the code to get the population data for each sex by year in the table? Pease help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 29 Mar 2024 22:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922319#M363198</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-29T22:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922320#M363199</link>
      <description>&lt;P&gt;You probably want to use the WEIGHT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;weight population;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I don't think population belongs in the CLASS statement.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 22:53:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922320#M363199</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-29T22:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922323#M363201</link>
      <description>&lt;P&gt;So would you suggest this instead? Sorry I've never used the weight statement&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.census3 format=5.;&lt;BR /&gt;format sex $sex.;&lt;BR /&gt;class sex county year / missing preloadfmt;&lt;BR /&gt;weight pop;&lt;BR /&gt;tables county=''*sex='', year='' /printmiss box='Sex' rts=20;&lt;BR /&gt;keylabel n=' ' all='Total';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 22:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922323#M363201</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-29T22:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922326#M363202</link>
      <description>&lt;P&gt;Does your code work?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922326#M363202</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-29T23:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922327#M363203</link>
      <description>&lt;P&gt;I tried this but it is now giving me the sum of the population for each year, but I want the individual populations for each sex. Any advice?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.census3 format=5.;&lt;BR /&gt;format sex sex.;&lt;BR /&gt;class county year / missing preloadfmt;&lt;BR /&gt;var sex / weight=pop;&lt;BR /&gt;tables county=''*sex='', year='' /printmiss box='Sex' rts=20;&lt;BR /&gt;keylabel n=' ';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922327#M363203</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-29T23:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922329#M363204</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mary_mcneill_0-1711755710094.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95037i9CD27477C2C44153/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mary_mcneill_0-1711755710094.png" alt="mary_mcneill_0-1711755710094.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922329#M363204</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-29T23:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922330#M363205</link>
      <description>&lt;P&gt;Now you have changed the code so that SEX is not a variable in the CLASS statement. It doesn't seem to me, based on your most recent words, that you want to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I suggested two changes, and you haven't run that code; instead you made other changes that I didn't suggest and it doesn't work. What happens when you run the code with only the changes I suggested?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922330#M363205</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-29T23:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922332#M363206</link>
      <description>&lt;P&gt;When I run this it does the same thing as before.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=work.census3 format=5.;&lt;BR /&gt;format sex sex.;&lt;BR /&gt;class sex county year / missing preloadfmt;&lt;BR /&gt;weight pop;&lt;BR /&gt;tables county=''*sex='', year='' /printmiss box='Sex' rts=20;&lt;BR /&gt;keylabel n=' ';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mary_mcneill_0-1711756396817.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95038iDB8640F2D6F1D8A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mary_mcneill_0-1711756396817.png" alt="mary_mcneill_0-1711756396817.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 23:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922332#M363206</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-29T23:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922333#M363207</link>
      <description>&lt;P&gt;Instead of the weight statement, try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var pop;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Mar 2024 00:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922333#M363207</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-30T00:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922335#M363209</link>
      <description>&lt;P&gt;Is your variable named POP or POPULATION? Is that variable numeric or character.&lt;/P&gt;
&lt;P&gt;This one reason that we suggest providing example data in the form of a working data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
   input County $ Year $ Sex $ pop;
datalines;
A 	2013 	Male 	545131
A 	2013 	Female 	64465
A 	2014 	Male 	6543513
A 	2014 	Female 	6546551
B 	2013 	Male 	65651
B 	2013 	Female 	6546541
;

proc tabulate data=have format=best12. ;
   class sex county year  / ;
   var POP;
   tables county=''*(sex='' all), 
           year=''*pop=' '*sum /printmiss box='Sex' rts=20;
   keylabel n=' ' all='Total' sum=' ';
run;&lt;/PRE&gt;
&lt;P&gt;Which yields:&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&lt;A name="IDX5" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Tabulate: Table 1" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" colspan="2" scope="colgroup"&gt;Sex&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;2013&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;2014&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" rowspan="3" scope="rowgroup"&gt;A&lt;/TH&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Female&lt;/TH&gt;
&lt;TD class="r b data"&gt;64465&lt;/TD&gt;
&lt;TD class="r b data"&gt;6546551&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Male&lt;/TH&gt;
&lt;TD class="r b data"&gt;545131&lt;/TD&gt;
&lt;TD class="r b data"&gt;6543513&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Total&lt;/TH&gt;
&lt;TD class="r b data"&gt;609596&lt;/TD&gt;
&lt;TD class="r b data"&gt;13090064&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" rowspan="3" scope="rowgroup"&gt;B&lt;/TH&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Female&lt;/TH&gt;
&lt;TD class="r b data"&gt;6546541&lt;/TD&gt;
&lt;TD class="r b data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Male&lt;/TH&gt;
&lt;TD class="r b data"&gt;65651&lt;/TD&gt;
&lt;TD class="r b data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;Total&lt;/TH&gt;
&lt;TD class="r b data"&gt;6612192&lt;/TD&gt;
&lt;TD class="r b data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You did not provide your Formats so we can't use them. So I removed all the preload format stuff as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Speaking of formats, you&amp;nbsp; are attempting to stuff values that start at 7 digits and then sum them resulting in 8 digit values into a 5 digit format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Mar 2024 02:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922335#M363209</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-30T02:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922348#M363215</link>
      <description>&lt;P&gt;same outcome.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 17:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922348#M363215</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-30T17:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922351#M363216</link>
      <description>&lt;P&gt;Show us your code. We can't help you if we don't know what you did.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 18:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922351#M363216</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-30T18:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922353#M363217</link>
      <description>&lt;P&gt;This worked!&lt;/P&gt;
&lt;P&gt;Yes, the variable name is pop, sorry I shortened it in my SAS program.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the variable types:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mary_mcneill_0-1711824933222.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95041iCF99E5F44C1D1B76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mary_mcneill_0-1711824933222.png" alt="mary_mcneill_0-1711824933222.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 18:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922353#M363217</guid>
      <dc:creator>mary_mcneill</dc:creator>
      <dc:date>2024-03-30T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922358#M363218</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You probably want to use the WEIGHT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;weight population;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I don't think population belongs in the CLASS statement.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since there were no VAR variables there wasn't anything to apply the Weight to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The FREQ statement would work allowing each observation to be counted POP times. A quick test shows that POP on the Class statement doesn't cause a problem if used as a FREQ variable, using the Have dataset in another post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;
proc tabulate data=have format=best12. ;
   class sex county year pop / ;
   freq POP;
   tables county=''*(sex='' all), 
           year=''*n/printmiss box='Sex' rts=20;
   keylabel n=' ' all='Total' sum=' ';
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 22:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/922358#M363218</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-30T22:18:48Z</dc:date>
    </item>
  </channel>
</rss>

