<?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 Currency Format Without Decimal Fraction When Output to Excel By Tagset in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18058#M3591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt; Excel treats all numbers using a general format. Usually, when you create output for Excel using ODS, Excel will mostly respect date values, but will otherwise display numbers and even some character values (like zip codes), as numbers. As Eric explained, using the TAGATTR= style attribute is the way to control which &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Microsoft &lt;/STRONG&gt;&lt;/SPAN&gt;format should be used by &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Excel &lt;/STRONG&gt;&lt;/SPAN&gt;to display the data once the ODS file is opened in Excel. This was the topic of one of my SAS Global Forum papers this year: ﻿&lt;A href="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt; ﻿﻿(complete with before/after screen shots and code examples).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jun 2011 14:13:46 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-06-27T14:13:46Z</dc:date>
    <item>
      <title>Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18055#M3588</link>
      <description>I use PROC REPORT to create a report and dump into Excel by tagsets.ExcelXP. I define the culumn by:&lt;BR /&gt;
define a9 /analysis sum format=dollar10. 'Sale' style(column)={background=lightyellow font_size=1.5};&lt;BR /&gt;
&lt;BR /&gt;
It comes out something like $100,789.00 or $200.00. How can I use a correct format to get rid of the decimal fraction?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Tue, 21 Jun 2011 14:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18055#M3588</guid>
      <dc:creator>c8826024</dc:creator>
      <dc:date>2011-06-21T14:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18056#M3589</link>
      <description>By default the format for currency in Excel puts decimal places.&lt;BR /&gt;
&lt;BR /&gt;
If you want Excel to do something else you'll have to provide an excel format on the column.  The tagattr style attribute can do this for you.&lt;BR /&gt;
&lt;BR /&gt;
Add the following to your style over rides on the define statement.&lt;BR /&gt;
&lt;BR /&gt;
tagattr=format:$###,###</description>
      <pubDate>Tue, 21 Jun 2011 16:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18056#M3589</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2011-06-21T16:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18057#M3590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try format dollar10.0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18057#M3590</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-27T08:10:07Z</dc:date>
    </item>
    <item>
      <title>Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18058#M3591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt; Excel treats all numbers using a general format. Usually, when you create output for Excel using ODS, Excel will mostly respect date values, but will otherwise display numbers and even some character values (like zip codes), as numbers. As Eric explained, using the TAGATTR= style attribute is the way to control which &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Microsoft &lt;/STRONG&gt;&lt;/SPAN&gt;format should be used by &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Excel &lt;/STRONG&gt;&lt;/SPAN&gt;to display the data once the ODS file is opened in Excel. This was the topic of one of my SAS Global Forum papers this year: ﻿&lt;A href="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt; ﻿﻿(complete with before/after screen shots and code examples).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 14:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18058#M3591</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-27T14:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18059#M3592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to use TAGATTR conditionally.&amp;nbsp; I used proc format to create a nested format so percents show up as percents and dollars show up as currently.&amp;nbsp; This is because my report displays both in in the same row demension.&amp;nbsp; It works great in SAS but when I run an ODS statement to excel, I have the same issue with excel adding the decimal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 21:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18059#M3592</guid>
      <dc:creator>benfirst321</dc:creator>
      <dc:date>2013-06-28T21:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Currency Format Without Decimal Fraction When Output to Excel By Tagset</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18060#M3593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Without seeing what procedure you're using when you say "my report displays both (percent and dollar) in the same row dimension", it is hard to comment. It might be possible using PROC REPORT and a CALL DEFINE. I'm not sure it's possible with TABULATE or PRINT. It sort of depends on the code of your FORMAT, too. The bottom line is that Excel has its own default way of formatting cells and, usually, your SAS formats are not respected or used by Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; That means you need to specify TAGATTR values with the proper FORMAT: value for TAGATTR. So my recommendation would be to figure out what the right TAGATTR is for a simple situation and then branch into whether it can be done conditionally using your nested formats. Since you did not post your PROC FORMAT code, any sample data or your other PROCEDURE code, it's hard to comment in more detail. But I pretty much am sure that your SAS nested format will NOT work "out of the box" for Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Perhaps the sample program below will get you pointed in the right direction for using TAGATTR. In the future it is helpful to start a new track instead of piggybacking on an already answered track. Then if you want to refer folks to the earlier track, you can just copy that tracks URL into your new track. I almost didn't read down to the end, because I saw that it was originally from 2011. If you need more help using TAGATTR for your code, then you might want to consider opening a track with Tech Support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data testit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines dlm=',';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input grpvar ordvar type $ num;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1,1,Sales,.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1,2,Total,2222.22&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;1,3,%,.5436&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;2,1,Returns,.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;2,2,Total,1111.11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;2,3,%,.4564&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;options missing = ' ';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp file='c:\temp\testfmt.xml' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=testit nowd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column grpvar ordvar type num;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define grpvar / group noprint;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define ordvar / order noprint;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define type / display style(column)=Header;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define num / display;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute num;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if type = 'Total' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_,'style','style={tagattr="Format:$#,###,#00."}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if type = '%' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define(_col_,'style','style={tagattr="Format:##0.00%"}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 03:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Currency-Format-Without-Decimal-Fraction-When-Output-to-Excel-By/m-p/18060#M3593</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-06-29T03:25:50Z</dc:date>
    </item>
  </channel>
</rss>

