<?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: Displaying a number as a number with the ExcelXP tagset in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/737#M335</link>
    <description>Hi jack,&lt;BR /&gt;
&lt;BR /&gt;
There is a bug there.  Part of it is that proc report says all those numbers are strings.  There is a workaround.&lt;BR /&gt;
&lt;BR /&gt;
tagattr now takes type:   You can set type to Number.   I do have a tagset&lt;BR /&gt;
fix in hand as well.  Here's an excerpt from the help for tagattr.&lt;BR /&gt;
&lt;BR /&gt;
TagAttr Style Element:   Default Value ''&lt;BR /&gt;
        Values: &lt;EXCELFORMAT&gt; or&lt;BR /&gt;
       &lt; datatype=""&gt;&lt;BR /&gt;
       &lt; excelformat=""&gt;&lt;BR /&gt;
       &lt; excelformula=""&gt;&lt;BR /&gt;
       &lt; degrees="" of="" rotation.=""&gt;&lt;BR /&gt;
 This is not a tagset option but a style attribute that the tagset will&lt;BR /&gt;
 use to get formula's and column formats. The format and formula's given&lt;BR /&gt;
 must be a valid to excel.  The rotation must be a valid angle for text.&lt;BR /&gt;
 90 through -90.&lt;BR /&gt;
The Type should be General, String, Numeric, or DateTime&lt;BR /&gt;
It should be unecessary to specify type except when DateTime is being used.&lt;BR /&gt;
&lt;BR /&gt;
A single value without a keyword is interpreted as a format.&lt;BR /&gt;
A formula, format and rotation can be specified together with keywords.&lt;BR /&gt;
There should be no spaces except for those between the two values&lt;BR /&gt;
The keyword and value must be separated by a ':' tagattr='format:###.## formula:SUM(R[-4]C:R[-1]C rotate:90').&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/EXCELFORMAT&gt;</description>
    <pubDate>Fri, 26 May 2006 20:17:55 GMT</pubDate>
    <dc:creator>Eric_SAS</dc:creator>
    <dc:date>2006-05-26T20:17:55Z</dc:date>
    <item>
      <title>Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/734#M332</link>
      <description>I don't understand why numbers are showing up as text in the XML spreadsheet created by the ExcelXP tagset.&lt;BR /&gt;
&lt;BR /&gt;
Here's some code:&lt;BR /&gt;
&lt;BR /&gt;
=====&lt;BR /&gt;
ods path WORK.TEMPLAT(WRITE) SASHELP.TMPLMST(READ);&lt;BR /&gt;
&lt;BR /&gt;
/* Get latest copy of tagset from SAS web site */                      &lt;BR /&gt;
filename tagset http                                                   &lt;BR /&gt;
   'http://support.sas.com:80/rnd/base/topics/odsmarkup/excltags.tpl'; &lt;BR /&gt;
%include tagset / nosource2;                                           &lt;BR /&gt;
filename tagset clear;                                                 &lt;BR /&gt;
&lt;BR /&gt;
data VolumeExpense;                                                             &lt;BR /&gt;
   length PurchMC ProvMC Type $8.;                                              &lt;BR /&gt;
   format Cost comma10.2;                                                       &lt;BR /&gt;
   do purchmc = 'Hay', 'Rch', 'Oak';                                            &lt;BR /&gt;
      do provmc = 'Oak', 'Hay', 'Rch';                                          &lt;BR /&gt;
         do type = 'Volume', 'Expense';                                         &lt;BR /&gt;
            cost = round(ranuni(94612)*100, .01);                               &lt;BR /&gt;
            output;                                                             &lt;BR /&gt;
         end;                                                                   &lt;BR /&gt;
      end;                                                                      &lt;BR /&gt;
   end;                                                                         &lt;BR /&gt;
run;                                                                            &lt;BR /&gt;
                                                                                &lt;BR /&gt;
ods tagsets.excelxp       &lt;BR /&gt;
      file='c:\temp\ExcelNum.xls' &lt;BR /&gt;
      options(sheet_name='Output from REPORT'                                   &lt;BR /&gt;
      frozen_headers='3'                                                        &lt;BR /&gt;
      row_repeat='1-3'                                                          &lt;BR /&gt;
      autofilter='2'                                                            &lt;BR /&gt;
      );                                                                        &lt;BR /&gt;
                                                                                &lt;BR /&gt;
proc report data=VolumeExpense missing nofs nocenter                            &lt;BR /&gt;
      completerows completecols;                                                &lt;BR /&gt;
   column purchmc type provmc, cost cost=totcost;                               &lt;BR /&gt;
   define purchmc / group 'Purch MC' width=8 order=data;                        &lt;BR /&gt;
   define type    / group 'Type'     width=8 order=data;                        &lt;BR /&gt;
   define provmc  / across 'Prov MC' width=8 order=data;                        &lt;BR /&gt;
   define Cost    / sum 'Cost'                                                  &lt;BR /&gt;
          style={tagattr='format:#,##0.00'};                                    &lt;BR /&gt;
   define totcost / sum 'Total Cost' width=10 format=comma10.2            &lt;BR /&gt;
          style={tagattr='format:#,##0.00'};                                    &lt;BR /&gt;
;                 &lt;BR /&gt;
   compute provmc;                                                              &lt;BR /&gt;
      if type = 'Expense' then                                                  &lt;BR /&gt;
         call define(_col_, 'style', 'style={background=yellow}');              &lt;BR /&gt;
   endcomp;                                                                     &lt;BR /&gt;
run;                                                                            &lt;BR /&gt;
&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
=====&lt;BR /&gt;
&lt;BR /&gt;
I added the style=tagattr=format:#,##0.00 in hopes of forcing Excel to treat it as a number, but no joy.&lt;BR /&gt;
&lt;BR /&gt;
How do I make this work?</description>
      <pubDate>Fri, 26 May 2006 01:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/734#M332</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2006-05-26T01:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/735#M333</link>
      <description>Call me john wayne, here, shooting from the hips and all, but I'll bet it something to do with the comma format. My guess is using something like 10.2 and I'll bet all will be right with your world.&lt;BR /&gt;
&lt;BR /&gt;
I had something similar come up when I wrote out numbers as Percent7.2, say and surprised to find (well, actually it was my boss, and, yeah, surprised will work here) that it came up 12.2% - sure did funny things to the spreadsheet.&lt;BR /&gt;
&lt;BR /&gt;
Like you, I'm still experimenting with the tagattr and format thingies, but so far I really like what I've seen.</description>
      <pubDate>Fri, 26 May 2006 15:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/735#M333</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-05-26T15:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/736#M334</link>
      <description>Alas, no, using 10.2 instead of comma10.2 doesn't solve the problem.&lt;BR /&gt;
&lt;BR /&gt;
That wouldn't be a satisfactory solution even if it did work - I'd have to choose between getting commas in Excel and getting commas in PDF.&lt;BR /&gt;
&lt;BR /&gt;
I think I'm overlooking something simple.</description>
      <pubDate>Fri, 26 May 2006 16:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/736#M334</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2006-05-26T16:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/737#M335</link>
      <description>Hi jack,&lt;BR /&gt;
&lt;BR /&gt;
There is a bug there.  Part of it is that proc report says all those numbers are strings.  There is a workaround.&lt;BR /&gt;
&lt;BR /&gt;
tagattr now takes type:   You can set type to Number.   I do have a tagset&lt;BR /&gt;
fix in hand as well.  Here's an excerpt from the help for tagattr.&lt;BR /&gt;
&lt;BR /&gt;
TagAttr Style Element:   Default Value ''&lt;BR /&gt;
        Values: &lt;EXCELFORMAT&gt; or&lt;BR /&gt;
       &lt; datatype=""&gt;&lt;BR /&gt;
       &lt; excelformat=""&gt;&lt;BR /&gt;
       &lt; excelformula=""&gt;&lt;BR /&gt;
       &lt; degrees="" of="" rotation.=""&gt;&lt;BR /&gt;
 This is not a tagset option but a style attribute that the tagset will&lt;BR /&gt;
 use to get formula's and column formats. The format and formula's given&lt;BR /&gt;
 must be a valid to excel.  The rotation must be a valid angle for text.&lt;BR /&gt;
 90 through -90.&lt;BR /&gt;
The Type should be General, String, Numeric, or DateTime&lt;BR /&gt;
It should be unecessary to specify type except when DateTime is being used.&lt;BR /&gt;
&lt;BR /&gt;
A single value without a keyword is interpreted as a format.&lt;BR /&gt;
A formula, format and rotation can be specified together with keywords.&lt;BR /&gt;
There should be no spaces except for those between the two values&lt;BR /&gt;
The keyword and value must be separated by a ':' tagattr='format:###.## formula:SUM(R[-4]C:R[-1]C rotate:90').&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/EXCELFORMAT&gt;</description>
      <pubDate>Fri, 26 May 2006 20:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/737#M335</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2006-05-26T20:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/738#M336</link>
      <description>Bang, bang, wrong again. One of these days, I'll get it right.&lt;BR /&gt;
&lt;BR /&gt;
So, Eric, I understand you to say that Jack should change his code to something like:&lt;BR /&gt;
define totcost / sum 'Total Cost' width=10 format=comma10.2 &lt;BR /&gt;
style={tagattr=&lt;B&gt;'type:number&lt;/B&gt; format:#,##0.00'};&lt;BR /&gt;
&lt;BR /&gt;
The format=comma10.2 would stay the same.&lt;BR /&gt;
&lt;BR /&gt;
In my case, I would do something similar?&lt;BR /&gt;
define totcost / sum 'Total Cost' width=10 format=&lt;B&gt;percent10.2&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
style={tagattr=&lt;B&gt;'type:number format:#,##0.00%&lt;/B&gt;'}; say (assuming I wanted a really, really big percent here).&lt;BR /&gt;
&lt;BR /&gt;
And, since I downloaded the tagset last week, along with with bunch of pdf papers and presentations, the tagset would be current.</description>
      <pubDate>Fri, 26 May 2006 21:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/738#M336</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-05-26T21:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/739#M337</link>
      <description>When I replace the two statements containing a TAGATTR with &lt;BR /&gt;
&lt;BR /&gt;
define Cost / sum 'Cost' style={tagattr='type:numeric format:#,##0.00'};&lt;BR /&gt;
&lt;BR /&gt;
define totcost / sum 'Total Cost' width=10 format=comma10.2 style={tagattr='type:numeric format:#,##0.00'};&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
I get an error when I try to open the resulting file in Excel.&lt;BR /&gt;
&lt;BR /&gt;
The error log has many entries of the form&lt;BR /&gt;
&lt;BR /&gt;
=====&lt;BR /&gt;
&lt;BR /&gt;
XML ERROR in Table&lt;BR /&gt;
REASON:	Bad Value&lt;BR /&gt;
FILE:	C:\Temp\ExcelNum.xls&lt;BR /&gt;
GROUP:	Cell&lt;BR /&gt;
TAG:	Data&lt;BR /&gt;
ATTRIB:	Type&lt;BR /&gt;
VALUE:	numeric&lt;BR /&gt;
=====  &lt;BR /&gt;
&lt;BR /&gt;
I tried editing the file to change"numeric" to "Numeric", but that didn't help.</description>
      <pubDate>Tue, 30 May 2006 20:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/739#M337</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2006-05-30T20:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/740#M338</link>
      <description>Well, I documented it incorrectly.  It should be Number, not numeric.  I changed the documentation and I'll add some error checking so that you'll get a message if an invalid type is used.&lt;BR /&gt;
&lt;BR /&gt;
Number worked for me.  number did not.</description>
      <pubDate>Wed, 31 May 2006 14:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/740#M338</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2006-05-31T14:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/741#M339</link>
      <description>If you use a percent format the tagset will figure that out and do the right thing.  That has been in place for over a year.  I don't know of any problems with getting it to set the type correctly when using percent formats inside SAS.  The tagset will set the format to percent and divide the number by 100 automatically.  This bug may affect it.  &lt;BR /&gt;
&lt;BR /&gt;
The most current tagset will be available sometime tomorrow.</description>
      <pubDate>Wed, 31 May 2006 14:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/741#M339</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2006-05-31T14:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/742#M340</link>
      <description>I downloaded the latest tagset and it seems to display all the numbers by default as numbers.  I am trying to get one column of numbers to stay strings.  I set the style as style={tagattr="Type:String"}.  This creates the following XML -- &lt;CELL styleid="data" index="1"&gt;&lt;DATA type="string"&gt;3.5&lt;/DATA&gt;&lt;/CELL&gt;.  That generates an error in Excel until I edit the XML file and change all occurrences of 'string' to 'String'.  What is the trick to make the tagset generate 'String' instead of 'string'?</description>
      <pubDate>Mon, 05 Jun 2006 16:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/742#M340</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-06-05T16:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/743#M341</link>
      <description>Try adding the text format "@" rather then setting the type to string. This will set the type to string automatically if you set the format to text.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data one;&lt;BR /&gt;
  x='0001';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp file="temp.xls";&lt;BR /&gt;
&lt;BR /&gt;
proc print data=one;&lt;BR /&gt;
var x / style={tagattr="format:@"};&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp close;</description>
      <pubDate>Tue, 06 Jun 2006 13:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/743#M341</guid>
      <dc:creator>Chevell_sas</dc:creator>
      <dc:date>2006-06-06T13:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/744#M342</link>
      <description>Thank you that works.</description>
      <pubDate>Tue, 06 Jun 2006 15:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/744#M342</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-06-06T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/745#M343</link>
      <description>I'm running into a similar problem...  I have a column of data with mixed datatypes; so I've converted everything to a character string.  For example, the data looks like:&lt;BR /&gt;
&lt;BR /&gt;
'100,000'&lt;BR /&gt;
'17.4%'&lt;BR /&gt;
'75'&lt;BR /&gt;
&lt;BR /&gt;
The problem I have is that when I output this, I lose the comma formatting.  It treats it as a numeric.  If I force the value to be a character string (style={tagattr="format:@"}; ) it still strips out my commas and in fact then messes with the percentage as well.&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to have it output the character strings as-is?&lt;BR /&gt;
&lt;BR /&gt;
On a sidenote, I tried to get around this by including a single quote in the string as well.  This worked to the extent that everything showed up as intended; however, the single quote wasn't interpreted by Excel.  It stuck around as part of the display value.</description>
      <pubDate>Tue, 20 Jun 2006 15:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/745#M343</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-06-20T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/746#M344</link>
      <description>It looks like we are stripping the value before applying the text format. Please open a tracking entry with Technical Support on this issue.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/contact/submit_emits2.html" target="_blank"&gt;http://support.sas.com/techsup/contact/submit_emits2.html&lt;/A&gt;.</description>
      <pubDate>Wed, 21 Jun 2006 14:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/746#M344</guid>
      <dc:creator>Chevell_sas</dc:creator>
      <dc:date>2006-06-21T14:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/747#M345</link>
      <description>This behavior is unavoidable.  The tagset uses a complex regular expression to determine if numbers are numbers.  The formatting must be stripped because Excel will turn it into a string if there are any currency symbols, comma's, percent signs etc.   The appropriate excel format must then be used in order to get the format you want.  Percentages are done for you.  The tagset finds the % so it knows to change the format to percentage.  In the other cases you will need to apply a format if the default format is not what you want.</description>
      <pubDate>Wed, 05 Jul 2006 14:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/747#M345</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2006-07-05T14:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/748#M346</link>
      <description>Eric, we were able to come up with an example to do what he wanted here by-passing the regular expressions. Hopefully, this did not expose anything else by doing so. &lt;BR /&gt;
&lt;BR /&gt;
proc template;                                                                                                                       &lt;BR /&gt;
 define tagset tagsets.test;                                                                                                         &lt;BR /&gt;
    parent=tagsets.excelxp;                                                                                                          &lt;BR /&gt;
      define event value_type;                                                                                                       &lt;BR /&gt;
        set $format "General";                                                                                                       &lt;BR /&gt;
         set $value strip(VALUE);                                                                                                    &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
      do /if $value;                                                                                                                 &lt;BR /&gt;
        do / if !tagattr;                                                                                                            &lt;BR /&gt;
          eval $is_numeric prxmatch($number,$value);                                                                                 &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
           do /if $is_numeric;                                                                                                       &lt;BR /&gt;
            set $type "Number";                                                                                                      &lt;BR /&gt;
            set $value compress($value,$punctuation);                                                                                &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
            do /if index(value, %nrstr("%%")) &amp;gt; 0;                                                                                   &lt;BR /&gt;
               set $format "Percent" /if index(value, %nrstr("%%")) &amp;gt; 0;                                                             &lt;BR /&gt;
               eval $tmp inputn($value,$test_format) / 100;                                                                          &lt;BR /&gt;
               set $value $tmp;                                                                                                      &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
            else /if index(value, $currency) &amp;gt; 0;                                                                                    &lt;BR /&gt;
               set $format $currency_format /if index(value, $currency) &amp;gt; 0;                                                         &lt;BR /&gt;
            done;                                                                                                                    &lt;BR /&gt;
          done;                                                                                                                      &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
         else;                                                                                                                       &lt;BR /&gt;
            set $type "String";                                                                                                      &lt;BR /&gt;
         done;                                                                                                                       &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
      done;                                                                                                                          &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
      do /if $attrs["type"];                                                                                                         &lt;BR /&gt;
         set $type $attrs["type" ];                                                                                                  &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
      else /if ^cmp( $type, "Number");                                                                                               &lt;BR /&gt;
         set $type "String";                                                                                                         &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
         do /if $is_numeric;                                                                                                         &lt;BR /&gt;
            set $type "Number" /if cmp( type, "int");                                                                                &lt;BR /&gt;
            set $type "Number" /if cmp( type, "double");                                                                             &lt;BR /&gt;
            set $type "String" /if cmp( type, "string");                                                                             &lt;BR /&gt;
         done;                                                                                                                       &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
      done;                                                                                                                          &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
   end;                                                                                                                              &lt;BR /&gt;
   end;                                                                                                                              &lt;BR /&gt;
   run;                                                                                                                              &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
   data one;                                                                                                                         &lt;BR /&gt;
     x='100%';                                                                                                                       &lt;BR /&gt;
     y=20000;                                                                                                                        &lt;BR /&gt;
     z=3.3;                                                                                                                          &lt;BR /&gt;
run;                                                                                                                                 &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
   ods tagsets.test file="temp.xls";                                                                                                 &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
   proc print data=one;                                                                                                              &lt;BR /&gt;
   var x / style={tagattr="format:@"};                                                                                               &lt;BR /&gt;
   var y / style={tagattr="format:###,###"};                                                                                         &lt;BR /&gt;
   var z ;                                                                                                                           &lt;BR /&gt;
   run;                                                                                                                              &lt;BR /&gt;
                                                                                                                                     &lt;BR /&gt;
   ods tagsets.test close;</description>
      <pubDate>Mon, 10 Jul 2006 16:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/748#M346</guid>
      <dc:creator>Chevell_sas</dc:creator>
      <dc:date>2006-07-10T16:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/749#M347</link>
      <description>Resurrecting an old thread...&lt;BR /&gt;
&lt;BR /&gt;
I can USE tagsets.excelxp, but I can't follow the suggestions above.  PROC TEMPLATE is all greek to me!&lt;BR /&gt;
&lt;BR /&gt;
I'm creating an XLS file with 3 tabs from 3 PROC TABULATE statements.  As is usual in TABULATE, missing values are shown as '.'.  I use the misstext='0' to put zeros in HTML output and such.  In Excel, the 0's are still formatted as text rather than numeric zero's.&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;My main question (and 2 bonuses):&lt;BR /&gt;
* How can I get zero values in TABULATE to show up as numeric?&lt;BR /&gt;
* [bonus1] How can I get rid of ODS styles to just have a plain Excel file with no ODS fomats (color, size, font, etc)?&lt;BR /&gt;
* [bonus2] How do I get excel to show commas as the thousands seperators?&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
I used the code below borrowed from JackH to hopefully make sure I'm running the most recent excelxp tagset.&lt;BR /&gt;
/* Get latest copy of tagset from SAS web site */ &lt;BR /&gt;
filename tagset http &lt;BR /&gt;
'http://support.sas.com:80/rnd/base/topics/odsmarkup/excltags.tpl'; &lt;BR /&gt;
%include tagset / nosource2; &lt;BR /&gt;
filename tagset clear; &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;My code looks like this:&lt;/B&gt;&lt;BR /&gt;
ods tagsets.excelxp file='desktop/myfile.xls' ;&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp options(sheet_name='All Heat Deaths');&lt;BR /&gt;
proc tabulate data=lib.datafile;&lt;BR /&gt;
  class datayear ageyrs ;&lt;BR /&gt;
  tables all ageyrs=' ', all datayear=' ' / misstext='0';&lt;BR /&gt;
  keylabel n=' ' all='Total';&lt;BR /&gt;
  format ageyrs ageten.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp options(sheet_name='CA Res Heat Deaths');&lt;BR /&gt;
/* another very similar proc tabulate */&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp options(sheet_name='Population data');&lt;BR /&gt;
/* another very similar proc tabulate */&lt;BR /&gt;
&lt;BR /&gt;
ods tagsets.excelxp close;</description>
      <pubDate>Wed, 06 Dec 2006 23:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/749#M347</guid>
      <dc:creator>JenHarper</dc:creator>
      <dc:date>2006-12-06T23:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying a number as a number with the ExcelXP tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/750#M348</link>
      <description>Jen:&lt;BR /&gt;
  There are many different pieces at work in your program. The zero as text issue IS a tagset issue and I understand the developers are working on an updated version of the ExcelXP tagset that fixes that issue. You will have to contact Tech Support about obtaining that tagset.&lt;BR /&gt;
  &lt;BR /&gt;
  So, for your other questions about 1) getting rid of styles and 2) getting the comma in Excel, I'm going to answer the second question first (because the first question will take more code...)&lt;BR /&gt;
[pre]&lt;B&gt;&lt;BR /&gt;
tables all*{s={tagattr='format:#,###,#00'}} ageyrs=' ',&lt;BR /&gt;
       all datayear=' ' /  rts=20 misstext='0'; &lt;/B&gt;[/pre]&lt;BR /&gt;
     &lt;BR /&gt;
the TAGATTR style override is sending a MICROSOFT format to Excel. This style override is telling ODS to send commas as the thousands separator ('format:#,###,#00'). You don't need the 'format:' if you're just sending a format, but I thought it looked better to explicitly send 'format:' for completeness. You would have to use that same style attribute override for any table components that you thought would need the comma format.&lt;BR /&gt;
  &lt;BR /&gt;
How you minimize the ODS styles is by using a modified style template. The key to modifying the style template is the fact that you either specify a value for certain attributes, like background color, foreground color and borderwidth (to name a few attributes) OR you turn them off. Turning them off is accomplished by using the _UNDEF_ style attribute. It's like saying -- I don't care what attributes are used, just use the default attributes of the rendering software. So, in my code below, there's a PROC TEMPLATE step that modifies the Statistical style to remove just about all the style attributes except the bold on the HEADER cells. Since I didn't have your data, I had to make some by using SASHELP.PRDSALE and then fiddling with variable values until I got some missing values.[pre]&lt;BR /&gt;
ods path sasuser.templat(update)&lt;BR /&gt;
         sashelp.tmplmst(read);&lt;BR /&gt;
        &lt;BR /&gt;
options missing=.;&lt;BR /&gt;
data dfile;&lt;BR /&gt;
  set sashelp.prdsale;&lt;BR /&gt;
  datayear = year;&lt;BR /&gt;
  ageyrs = (today()-month)/365.25;&lt;BR /&gt;
  if year = 1994 and division = 'CONSUMER' then datayear = datayear - 2;&lt;BR /&gt;
  if division = 'CONSUMER' then ageyrs=ageyrs-5;&lt;BR /&gt;
  if division = 'EDUCATION' and prodtype='FURNITURE' then ageyrs=.;&lt;BR /&gt;
run;&lt;BR /&gt;
                             &lt;BR /&gt;
proc format;&lt;BR /&gt;
  value ageten low-&amp;lt;10 = 'Group 1'&lt;BR /&gt;
               10-20 = 'Group 2';&lt;BR /&gt;
run;&lt;BR /&gt;
             &lt;BR /&gt;
** Modify the Minimal style to get rid of;&lt;BR /&gt;
** all border lines, colors, etc;&lt;BR /&gt;
proc template;&lt;BR /&gt;
  define style styles.XLStatistical;&lt;BR /&gt;
    parent = styles.Statistical;&lt;BR /&gt;
	style Body from Body/&lt;BR /&gt;
	  background=_undef_;&lt;BR /&gt;
	style table from Output /&lt;BR /&gt;
	  background=_undef_&lt;BR /&gt;
	  foreground=_undef_&lt;BR /&gt;
	  borderwidth=_undef_&lt;BR /&gt;
          font_size=10pt;&lt;BR /&gt;
    style Header from Header /&lt;BR /&gt;
      background=_undef_&lt;BR /&gt;
      foreground=_undef_&lt;BR /&gt;
      borderwidth=_undef_&lt;BR /&gt;
      font_size=10pt;&lt;BR /&gt;
    style RowHeader from RowHeader /&lt;BR /&gt;
      background=_undef_&lt;BR /&gt;
      foreground=_undef_&lt;BR /&gt;
      borderwidth=_undef_&lt;BR /&gt;
      font_size=10pt;&lt;BR /&gt;
    style Data from Data /&lt;BR /&gt;
      background=_undef_&lt;BR /&gt;
      foreground=_undef_&lt;BR /&gt;
      borderwidth=_undef_&lt;BR /&gt;
      font_size=10pt;&lt;BR /&gt;
  end;&lt;BR /&gt;
run; &lt;BR /&gt;
             &lt;BR /&gt;
ods tagsets.excelxp file='c:\temp\use_style.xls' &lt;BR /&gt;
    style=styles.XLStatistical;&lt;BR /&gt;
ods tagsets.excelxp options(sheet_name='All Heat Deaths');&lt;BR /&gt;
options missing=0;&lt;BR /&gt;
proc tabulate data=dfile f=comma9.;&lt;BR /&gt;
class datayear ageyrs;&lt;BR /&gt;
tables all*{s={tagattr='format:#,###,#00'}} ageyrs=' ',&lt;BR /&gt;
       all datayear=' ' /  rts=20 misstext='0';&lt;BR /&gt;
keylabel n=' ' all='Total';&lt;BR /&gt;
format ageyrs ageten.;&lt;BR /&gt;
run;&lt;BR /&gt;
ods tagsets.excelxp close; [/pre]&lt;BR /&gt;
Once I create styles.XLStatistical, I have to use in the ODS invocation for tagsets.excelxp.&lt;BR /&gt;
  &lt;BR /&gt;
That still doesn't address your zero as text issue, but I did check with the developers and they are working on getting an updated version of the ExcelXP tagset approved now. When they do, it will be posted here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/base/topics/odsmarkup/" target="_blank"&gt;http://support.sas.com/rnd/base/topics/odsmarkup/&lt;/A&gt;&lt;BR /&gt;
(scroll down the page an look for the heading &lt;B&gt;"Updated SAS 9.1 Tagsets to Download Individually"&lt;/B&gt; and you will find a place to download an updated tagset. Right now, the ExcelXP tagset is dated June 2006 -- that one still has the zero as text issue so you either have to wait for an updated one (should have an October or November date) or contact Tech Support to get the updated tagset before it's posted.&lt;BR /&gt;
  &lt;BR /&gt;
Once you have the updated tagset, you have to do just 3 things:&lt;BR /&gt;
1) use an ODS PATH statement to point to your template storage location&lt;BR /&gt;
2) run the code to update your template storage location with the new tagset for ExcelXP and the new style template&lt;BR /&gt;
3) use the updated tagsets.excelxp tagset and the new style template&lt;BR /&gt;
 &lt;BR /&gt;
Using the ODS PATH statement will ensure that the updated tagset and style gets written to SASUSER.TEMPLAT template storage location. Since I don't know whether you have used the ODS PATH statement before, I included one in my code: [pre]&lt;BR /&gt;
ods path sasuser.templat(update)&lt;BR /&gt;
         sashelp.tmplmst(read);[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Of course, if you don't want to use the SASUSER library, that's fine, you just have to put some other permanent location in your ODS PATH statement so ODS knows where to look for the updated templates.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 08 Dec 2006 16:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Displaying-a-number-as-a-number-with-the-ExcelXP-tagset/m-p/750#M348</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2006-12-08T16:02:13Z</dc:date>
    </item>
  </channel>
</rss>

