<?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, format comma ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17433#M3306</link>
    <description>Hi:&lt;BR /&gt;
  If statistics based on AMOUNT are all you have in your table, then a very simple way to achieve the formatting you want is to do this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc tabulate data=xxxx.data f=comma16.&lt;BR /&gt;
     out=yyyyyy.data(label="Something");&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                                                           &lt;BR /&gt;
add the f= or format= option to the PROC TABULATE statement. It can go anywhere, but must be placed before the semi-colon that ends the statement.&lt;BR /&gt;
 &lt;BR /&gt;
In more complicated situations, such as where you want some statistics to have a comma16. format, but other statistics to have the comma16.2 format (for example), you would then need to request the format in the TABLE statement. Like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
table Product all,&lt;BR /&gt;
      othervar*(amount=' '*Sum=' '*f=comma16.2)&lt;BR /&gt;
      all*(amount=' '*Sum=' '*f=comma16.0);&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                          &lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 10 Apr 2009 15:28:40 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-04-10T15:28:40Z</dc:date>
    <item>
      <title>Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17432#M3305</link>
      <description>Having searched the web, form and documentation I am stil stumped on something that must be really simple...how to format the values in a tabulate report. The default gives nnnnnnnnnn.nn , but I need comma format to make the report more readable.&lt;BR /&gt;
&lt;BR /&gt;
This is the simplest of cross-tab reports.&lt;BR /&gt;
__________________________________________________________&lt;BR /&gt;
Code:&lt;BR /&gt;
&lt;BR /&gt;
PROC TABULATE&lt;BR /&gt;
DATA=ECLIB000.ALL_EVENTS&lt;BR /&gt;
&lt;BR /&gt;
	OUT=SASUSER.STABSummaryTablesALL_EVENTS(LABEL="Summary Tables  for ECLIB000.ALL_EVENTS")&lt;BR /&gt;
	&lt;BR /&gt;
	;&lt;BR /&gt;
	VAR amount;&lt;BR /&gt;
	CLASS TO_Product /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	CLASS FROM_Product /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	TABLE &lt;BR /&gt;
		/* ROW Statement */&lt;BR /&gt;
		FROM_Product &lt;BR /&gt;
		all = 'Total'  ,&lt;BR /&gt;
		/* COLUMN Statement */&lt;BR /&gt;
		TO_Product *(amount=' ' * Sum=' ' )&lt;BR /&gt;
		all = 'Total'  *(amount=' ' * Sum=' ' ) 		;&lt;BR /&gt;
	;&lt;BR /&gt;
&lt;BR /&gt;
RUN;&lt;BR /&gt;
____________________________________________________________________&lt;BR /&gt;
&lt;BR /&gt;
It would be most helpful if someone would show me where the formatting instructions need to go in order to produce COMMA16. "amount" output.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance !&lt;BR /&gt;
DBM</description>
      <pubDate>Fri, 10 Apr 2009 15:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17432#M3305</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-10T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17433#M3306</link>
      <description>Hi:&lt;BR /&gt;
  If statistics based on AMOUNT are all you have in your table, then a very simple way to achieve the formatting you want is to do this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc tabulate data=xxxx.data f=comma16.&lt;BR /&gt;
     out=yyyyyy.data(label="Something");&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                                                           &lt;BR /&gt;
add the f= or format= option to the PROC TABULATE statement. It can go anywhere, but must be placed before the semi-colon that ends the statement.&lt;BR /&gt;
 &lt;BR /&gt;
In more complicated situations, such as where you want some statistics to have a comma16. format, but other statistics to have the comma16.2 format (for example), you would then need to request the format in the TABLE statement. Like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
table Product all,&lt;BR /&gt;
      othervar*(amount=' '*Sum=' '*f=comma16.2)&lt;BR /&gt;
      all*(amount=' '*Sum=' '*f=comma16.0);&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                          &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 10 Apr 2009 15:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17433#M3306</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-10T15:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17434#M3307</link>
      <description>Excellent, and thank you. This works nicely.&lt;BR /&gt;
&lt;BR /&gt;
Related question: is there any way to do this within the EG wizard ? It would seem to be an obvious requirement to format output, yet I cannot see where one has the opportunity to do so.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again for your attention and especially promptness.</description>
      <pubDate>Sat, 11 Apr 2009 14:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17434#M3307</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-11T14:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17435#M3308</link>
      <description>Hi:&lt;BR /&gt;
  Sadly, I do not have EG on this machine to double check, but I have some memory of right-clicking on the variable name or the statistic name and choosing Properties in order to assign a format. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Sat, 11 Apr 2009 15:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17435#M3308</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-11T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17436#M3309</link>
      <description>Again thanks for your attention, Cynthia.&lt;BR /&gt;
&lt;BR /&gt;
In EG tabulate is accessed through a wizard. When one selects the variable(s) to place in the tab construct there is no way to specify format. That is where it belongs (second screen in the EG wizard) - a useful addition - perhaps could be added to the development queue foir the benefit of the Base SAS challenged. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Sun, 12 Apr 2009 14:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17436#M3309</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-12T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate, format comma ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17437#M3310</link>
      <description>HI...my memory is that when you drag and drop the variables into the table designer in the Summary Tables Task, that there is a way to Right-click on the variable name and set the format. I think it's Properties off the Right-click menu that comes up. &lt;BR /&gt;
  &lt;BR /&gt;
cynthia</description>
      <pubDate>Sun, 12 Apr 2009 15:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-format-comma/m-p/17437#M3310</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-12T15:49:54Z</dc:date>
    </item>
  </channel>
</rss>

