<?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 Formatting percentage field in Proc Print in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276377#M16038</link>
    <description>&lt;P&gt;I am sending a table from EG to an excel file using ODS and proc print.&lt;/P&gt;&lt;P&gt;The percentage field in SAS table that is going to the Excel has numbers like below.&lt;/P&gt;&lt;P&gt;94.9%&lt;BR /&gt;24.4%&lt;BR /&gt;95.5%&lt;BR /&gt;7.1%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when the SAS table gets to an excel file the format&amp;nbsp;shows with two decimal point like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;94.90%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24.40%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;95.50%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried percent7.1, percent8.1 but neither works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code. I need to know how to fix the issue so in excel the percentage field is one decimal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*********************************************************************************&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP style= mystyle file="excelfile.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options(sheet_name='tab1' autofilter='all' orientation='landscape');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=table1 noobs split= '/'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;style(header) = { font_style=italic font_weight = bold font_face = "calibri" font_size = &lt;STRONG&gt;8&lt;/STRONG&gt;pt just = c}&lt;/P&gt;&lt;P&gt;style(data) = {font_face = "Calibri" font_size = &lt;STRONG&gt;8&lt;/STRONG&gt;pt};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var startdt enddt client_id custid /style(header) ={foreground = white background = #ff6600};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Target /style(header) = vertical_header {foreground = black background = #ccccff};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Pct_Touched Pct_Enrolled pct_part /style(header) = vertical_header {foreground = black background = #ccff99};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format Target Pct_Touched Pct_Enrolled pct_part percent8.1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP close;&lt;/P&gt;&lt;P&gt;*************************************************************************************&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2016 23:12:55 GMT</pubDate>
    <dc:creator>sasmom</dc:creator>
    <dc:date>2016-06-09T23:12:55Z</dc:date>
    <item>
      <title>Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276377#M16038</link>
      <description>&lt;P&gt;I am sending a table from EG to an excel file using ODS and proc print.&lt;/P&gt;&lt;P&gt;The percentage field in SAS table that is going to the Excel has numbers like below.&lt;/P&gt;&lt;P&gt;94.9%&lt;BR /&gt;24.4%&lt;BR /&gt;95.5%&lt;BR /&gt;7.1%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when the SAS table gets to an excel file the format&amp;nbsp;shows with two decimal point like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;94.90%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24.40%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;95.50%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried percent7.1, percent8.1 but neither works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code. I need to know how to fix the issue so in excel the percentage field is one decimal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*********************************************************************************&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP style= mystyle file="excelfile.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options(sheet_name='tab1' autofilter='all' orientation='landscape');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=table1 noobs split= '/'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;style(header) = { font_style=italic font_weight = bold font_face = "calibri" font_size = &lt;STRONG&gt;8&lt;/STRONG&gt;pt just = c}&lt;/P&gt;&lt;P&gt;style(data) = {font_face = "Calibri" font_size = &lt;STRONG&gt;8&lt;/STRONG&gt;pt};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var startdt enddt client_id custid /style(header) ={foreground = white background = #ff6600};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Target /style(header) = vertical_header {foreground = black background = #ccccff};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Pct_Touched Pct_Enrolled pct_part /style(header) = vertical_header {foreground = black background = #ccff99};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format Target Pct_Touched Pct_Enrolled pct_part percent8.1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP close;&lt;/P&gt;&lt;P&gt;*************************************************************************************&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 23:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276377#M16038</guid>
      <dc:creator>sasmom</dc:creator>
      <dc:date>2016-06-09T23:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276387#M16040</link>
      <description>&lt;P&gt;The format statement won't work here - you will &amp;nbsp;need to include the Excel formatting options in the ODS style options of your variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var Target /
  &lt;STRONG&gt;style={tagattr='format:0.0%'}&lt;/STRONG&gt;
  style(header) = vertical_header {foreground = black background = #ccccff}
  ;
var Pct_Touched Pct_Enrolled pct_part /
  &lt;STRONG&gt;style={tagattr='format:0.0%'}&lt;/STRONG&gt;
  style(header) = vertical_header {foreground = black background = #ccff99}
  ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note you must have the "style" option&amp;nbsp;&lt;STRONG&gt;before&lt;/STRONG&gt; the "style(header)" option..&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are some excellent ODS EXCELXP whitepapers out there:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings10/031-2010.pdf" target="_blank"&gt;ODS ExcelXP: Tag Attr Is It! Using and Understanding the TAGATTR= Style Attribute with the ExcelXP Tagset Eric Gebhart, SAS Institute Inc., Cary, NC&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings11/266-2011.pdf" target="_self"&gt;Don’t Gamble with Your Output: How to Use Microsoft Formats with ODS Cynthia L. Zender, SAS Institute, Inc., Cary, NC, USA&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/170-2011.pdf" target="_blank"&gt;Creating Stylish Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS® Vincent DelGobbo, SAS Institute Inc., Cary, NC&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://www.lexjansen.com/nesug/nesug11/gr/gr03.pdf" target="_blank"&gt;Multi-sheet Workbooks from SAS ® data using the ODS ExcelXP tagset or Another Way to EXCEL using SAS Cynthia A. Stetz, Bank of America Merrill Lynch, Hopewell NJ&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://www.lexjansen.com/pharmasug/2010/CC/CC22.pdf" target="_blank"&gt;SAS to Excel with ExcelXP Tagset Mahipal Vanam, Kiran Karidi and Sridhar Dodlapati &lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So it's worth doing a little research to get fully informed (&lt;EM&gt;whereas the Discussions can often be a one-off answer to a one-off question)&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best best is to go to &lt;A href="http://www.lexjansen.com/" target="_blank"&gt;Lex Jansen's website&lt;/A&gt; and search for &lt;STRONG&gt;ExcelXP&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's a &lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html" target="_blank"&gt;Focus Area on ExcelXP tagsets&lt;/A&gt;&amp;nbsp;in the support.sas.com site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.. and keep an eye on anything&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger﻿&lt;/a&gt;&amp;nbsp;posts on the subject &lt;A href="http://blogs.sas.com/content/sasdummy/2014/08/29/experimenting-with-ods-excel-to-create-spreadsheets-from-sas/" target="_blank"&gt;in his SasDummy blog&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 01:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276387#M16040</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2016-06-10T01:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276396#M16041</link>
      <description>&lt;P&gt;Best resource for tagset questions is here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf" target="_blank"&gt;http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 01:57:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276396#M16041</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-10T01:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276490#M16042</link>
      <description>&lt;P&gt;THANKS! That worked!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 13:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276490#M16042</guid>
      <dc:creator>sasmom</dc:creator>
      <dc:date>2016-06-10T13:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276491#M16043</link>
      <description>&lt;P&gt;Thanks Reeza for the link.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 13:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276491#M16043</guid>
      <dc:creator>sasmom</dc:creator>
      <dc:date>2016-06-10T13:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting percentage field in Proc Print</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276646#M16046</link>
      <description>&lt;P&gt;See also this video that features&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13736"&gt;@Chevell_sas﻿&lt;/a&gt; &lt;A href="http://sasgf16.v.sas.com/detail/video/4854760676001/sas-tech-talk:-how-to-create-spreadsheets-from-sas-using-ods-excel?autoStart=true" target="_self"&gt;demoing some cool features of ODS EXCEL&lt;/A&gt;, including formulas and formatting.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2016 03:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-percentage-field-in-Proc-Print/m-p/276646#M16046</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-06-11T03:33:15Z</dc:date>
    </item>
  </channel>
</rss>

