<?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: Excel text format using Proc Tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/543121#M150127</link>
    <description>Hi,&lt;BR /&gt;I used format and style_precedence and didn't work. The style is applied to the column not to the rows.</description>
    <pubDate>Thu, 14 Mar 2019 12:28:36 GMT</pubDate>
    <dc:creator>rodrichiez</dc:creator>
    <dc:date>2019-03-14T12:28:36Z</dc:date>
    <item>
      <title>Excel text format using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542944#M150066</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the excel text format&amp;nbsp;[tagattr="format:@"] in the column ID_NACIONAL but I noticed the format is applied to the columns definition even I didn't create the style element in that section. I've tried to put the statement in other sections of the code but I don't get to make it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE 
DATA=WORK.MCR_CONSULTA
	
	;
	
	VAR IDRazon MONTO;
	CLASS DescRazon /	ORDER=UNFORMATTED MISSING;
	CLASS NOMBRE_DEM / 	ORDER=UNFORMATTED MISSING style=[width=2.5in];
	CLASS ID_NACIONAL / ORDER=UNFORMATTED MISSING;
	CLASS "APLICA"n /	ORDER=UNFORMATTED MISSING;
	TABLE 
		/* ROW Statement */
		NOMBRE_DEM  * ID_NACIONAL = 'ID_NACIONAL' * [style=[tagattr="format:@"]]  * "APLICA"n ,

		/* COLUMN Statement */
		DescRazon *(IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' )
		all = 'Total' * [style=[background=lightgrey fontweight=bold]] * (IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' * f=dollar10. );

 

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 21:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542944#M150066</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2019-03-13T21:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Excel text format using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542970#M150074</link>
      <description>&lt;P&gt;There is an option on the Table statement in Proc Tabulate that &lt;STRONG&gt;might&lt;/STRONG&gt; be related to your issue: FORMAT_PRECEDENCE. This option specifies the precedence of a format applied to a column, row or page controls and default is COLUMN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't test anything as&amp;nbsp;no example data was provided much less how the results are sent to Excel.&lt;/P&gt;
&lt;P&gt;I would try changing:&lt;/P&gt;
&lt;PRE&gt;		all = 'Total' * [style=[background=lightgrey fontweight=bold]] * (IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' * f=dollar10. );

&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;	all = 'Total' * [style=[background=lightgrey fontweight=bold]] 
         * (IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' * f=dollar10. )
     / Format_Precedence=Row
   ;
&lt;/PRE&gt;
&lt;P&gt;the / starts table level options. I made the code a bit narrower so it was easier to read. I hate having to scroll horizontally to finish a line.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 23:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542970#M150074</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-13T23:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Excel text format using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542982#M150078</link>
      <description>Hi:&lt;BR /&gt;  In addition to FORMAT_PRECEDENCE as a TABLE option, there is also an option for STYLE_PRECEDENCE, which indicates which style attributes should "win" in the case of conflicting style specifications.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 14 Mar 2019 00:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/542982#M150078</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-14T00:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Excel text format using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/543121#M150127</link>
      <description>Hi,&lt;BR /&gt;I used format and style_precedence and didn't work. The style is applied to the column not to the rows.</description>
      <pubDate>Thu, 14 Mar 2019 12:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/543121#M150127</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2019-03-14T12:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Excel text format using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/543152#M150134</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After many reading and investigation I've found the solution using classlev as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE
DATA=WORK.MCR_CONSULTA

;

VAR IDRazon MONTO;
CLASS DescRazon / ORDER=UNFORMATTED MISSING;
CLASS NOMBRE_DEM / ORDER=UNFORMATTED MISSING style=[width=2.5in];
CLASS ID_NACIONAL / ORDER=UNFORMATTED MISSING;
&lt;STRONG&gt;CLASSLEV ID_NACIONAL / S=[tagattr="format:@"];&lt;/STRONG&gt;
CLASS "APLICA"n / ORDER=UNFORMATTED MISSING;
TABLE 
/* ROW Statement */
NOMBRE_DEM * ID_NACIONAL = 'ID_NACIONAL' * "APLICA"n,

/* COLUMN Statement */
DescRazon *(IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' )
all = 'Total' * [style=[background=lightgrey fontweight=bold]] * (IDRazon=' ' * Sum=' ' MONTO=' ' * Sum=' ' * f=dollar10.);



RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;CLASSLEV can be use to specify format to the values of a class variable.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 13:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-text-format-using-Proc-Tabulate/m-p/543152#M150134</guid>
      <dc:creator>rodrichiez</dc:creator>
      <dc:date>2019-03-14T13:39:49Z</dc:date>
    </item>
  </channel>
</rss>

