<?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 - naming the table... in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200273#M13377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One solution you'd be looking for is a simple macro variable. Note the changes in the code to use " instead of ' to allow resolution of the macro variable, the reference the variable has &amp;amp; and first . in &amp;amp;topic..html says that what follows is concatenated with the variable but since you want a dot as part of the file name you need a second one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let topic=wombat;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file="c:\temp\&amp;amp;topic..html";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc tabulate data=sashelp.shoes out=work.table_&amp;amp;topic;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where product contains 'Casual';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;class region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;var sales returns;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; table region all,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sales*(sum mean) returns*sum;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Next step would be actual macro programming, parameters and fun.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Aug 2015 15:51:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-08-18T15:51:00Z</dc:date>
    <item>
      <title>Proc tabulate - naming the table...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200270#M13374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm new to SAS and need to create many tables which are a cross tabulated format.&lt;/P&gt;&lt;P&gt;These outputs will then be exported and referenced by excel which will generate charts and conditional formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trouble is that I don't seem to be able to name the output table with the proc tabulate - they all get called summary table1 etc.&amp;nbsp; When there will be so many tables, how can I then know which to export and save as what...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried multiple google searches and not returned much, as well as looked at these forums but not found this specific answer.&amp;nbsp; The questions to date are about naming the variables - not the table.&lt;/P&gt;&lt;P&gt;If there is documentation that directs on this, please could you tell me the name of the manuals to look at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;JJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 12:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200270#M13374</guid>
      <dc:creator>jjoliver1981</dc:creator>
      <dc:date>2015-08-17T12:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate - naming the table...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200271#M13375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; It depends on your code and your destination how you will name the TABULATE output tables. Are you using OUT= to name the output data or are you using ODS? For me, this works to make one output file named KOALA.HTML and the other output file is named WOMBAT.HTML. Then the OUT= option in each step makes an output dataset from the TABULATE procedure.&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\&lt;SPAN style="color: #ff00ff;"&gt;koala&lt;/SPAN&gt;.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc tabulate data=sashelp.shoes out=work.table_koala;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where product contains 'Casual';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;class region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;var sales inventory;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; table region all,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sales*(sum mean) inventory*sum;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\&lt;SPAN style="color: #ff00ff;"&gt;wombat&lt;/SPAN&gt;.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc tabulate data=sashelp.shoes out=work.table_wombat;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where product contains 'Casual';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;class region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;var sales returns;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; table region all,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sales*(sum mean) returns*sum;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 23:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200271#M13375</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-08-17T23:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate - naming the table...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200272#M13376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Thank you this worked perfectly.&lt;/P&gt;&lt;P&gt;For 10 extra points ;-), using your example above, could you tell me if it's possible to set sales to be "cupcakes" before hand, and then have "cupcakes" in the code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reason for asking is that I have multiple iterations of this code, generating numerous tables to be analysed, and to set that variable in advance and have to only change it in one place would reduce risk of errors creeping in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 10:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200272#M13376</guid>
      <dc:creator>jjoliver1981</dc:creator>
      <dc:date>2015-08-18T10:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate - naming the table...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200273#M13377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One solution you'd be looking for is a simple macro variable. Note the changes in the code to use " instead of ' to allow resolution of the macro variable, the reference the variable has &amp;amp; and first . in &amp;amp;topic..html says that what follows is concatenated with the variable but since you want a dot as part of the file name you need a second one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let topic=wombat;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file="c:\temp\&amp;amp;topic..html";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc tabulate data=sashelp.shoes out=work.table_&amp;amp;topic;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where product contains 'Casual';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;class region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;var sales returns;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; table region all,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sales*(sum mean) returns*sum;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Next step would be actual macro programming, parameters and fun.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 15:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200273#M13377</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-18T15:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate - naming the table...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200274#M13378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And, for the extra 10 points, here's a paper I wrote about Macro Basics for New SAS Users: &lt;A href="https://support.sas.com/resources/papers/proceedings13/120-2013.pdf" title="https://support.sas.com/resources/papers/proceedings13/120-2013.pdf"&gt;https://support.sas.com/resources/papers/proceedings13/120-2013.pdf&lt;/A&gt;&amp;nbsp;&amp;nbsp; It may help you get started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 00:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-tabulate-naming-the-table/m-p/200274#M13378</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-08-19T00:55:33Z</dc:date>
    </item>
  </channel>
</rss>

