<?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: Create a table by year/month/sites? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-table-by-year-month-sites/m-p/859091#M82498</link>
    <description>&lt;P&gt;Data is helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc tabulate is a very likely candidate as I find it easier to nest things vertically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what goes into the intersection of month and site columns?&lt;/P&gt;
&lt;P&gt;Here is an example of a similar report using the SASHELP.STOCKS set that you likely have available. The first data step basically just adds a month variable.&lt;/P&gt;
&lt;PRE&gt;data fortable;
   set sashelp.stocks;
   month=month(date);
run;

proc tabulate data=fortable;
   class date month stock;
   format date year4.;
   var close;
   table month,
         date*stock=' '*close="Max close"*max=''*f=dollar10.2
         /misstext=' '
   ;
run;
&lt;/PRE&gt;
&lt;P&gt;The =' ' that appear are just to modify the default column heading text. When it is '' or ' ' then that suppresses a level of the column (or row) heading. This report show the maximum closing price of each Stock, which would be your SITE variable, for each month.&lt;/P&gt;
&lt;P&gt;I am using the format YEAR4. on a date value to just display the year.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 00:48:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-02-16T00:48:47Z</dc:date>
    <item>
      <title>Create a table by year/month/sites?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-table-by-year-month-sites/m-p/859089#M82497</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to create a table for top row is year, the most left column is month, then site is the subgroup under year.&amp;nbsp; I'm not sure if there is a way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 00:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-table-by-year-month-sites/m-p/859089#M82497</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2023-02-16T00:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table by year/month/sites?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-table-by-year-month-sites/m-p/859091#M82498</link>
      <description>&lt;P&gt;Data is helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc tabulate is a very likely candidate as I find it easier to nest things vertically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what goes into the intersection of month and site columns?&lt;/P&gt;
&lt;P&gt;Here is an example of a similar report using the SASHELP.STOCKS set that you likely have available. The first data step basically just adds a month variable.&lt;/P&gt;
&lt;PRE&gt;data fortable;
   set sashelp.stocks;
   month=month(date);
run;

proc tabulate data=fortable;
   class date month stock;
   format date year4.;
   var close;
   table month,
         date*stock=' '*close="Max close"*max=''*f=dollar10.2
         /misstext=' '
   ;
run;
&lt;/PRE&gt;
&lt;P&gt;The =' ' that appear are just to modify the default column heading text. When it is '' or ' ' then that suppresses a level of the column (or row) heading. This report show the maximum closing price of each Stock, which would be your SITE variable, for each month.&lt;/P&gt;
&lt;P&gt;I am using the format YEAR4. on a date value to just display the year.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 00:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-table-by-year-month-sites/m-p/859091#M82498</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-16T00:48:47Z</dc:date>
    </item>
  </channel>
</rss>

