<?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: Maintaining formats in ods excel &amp;quot;percent&amp;quot; in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Maintaining-formats-in-ods-excel-quot-percent-quot/m-p/325968#M17761</link>
    <description>&lt;P&gt;SAS doesn't work like Excel. &amp;nbsp;In SAS the whole column has to have the same format. &amp;nbsp;You could of course make the whole column text, then it can contain anything, but it wouldn't be numeric in the Excel file, i.e:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length pformatted $100;
  pformatted=ifc(val=0,"0",put(val,percent8,2));
run;&lt;/PRE&gt;
&lt;P&gt;Pformatted would then be the variable you print out which would contain xyz% and 0's. &amp;nbsp;Thats the simplest method I can think of. &amp;nbsp;Now you may also be able to do thi using compute blocks and call style, something like:&lt;/P&gt;
&lt;PRE&gt;proc report...;
  ...
  compute pval;
    if pval ne 0 then call define(_col_,'style','style=[tagattr="format:#,###.00%"]');
  endcomp;
run;
&lt;/PRE&gt;
&lt;P&gt;I don't have any data to test this on, but that should give some ideas.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2017 13:56:19 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-01-19T13:56:19Z</dc:date>
    <item>
      <title>Maintaining formats in ods excel "percent"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Maintaining-formats-in-ods-excel-quot-percent-quot/m-p/325943#M17760</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My requirement is to print percentage9.1 format in excel . If the data has 0 in decimal point then that should be ignored.&lt;/P&gt;
&lt;P&gt;note: I have tried converting to character as well but did not work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Forexample:&lt;/P&gt;
&lt;P&gt;If I am printing x variable with value as 99.0% then it should be printing 99% in excel and if it has a value of 99.1% then it should print the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have tried&lt;/P&gt;
&lt;P&gt;1.&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = {tagattr=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'type:String'};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;2.type:@&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;3.type:@\%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 12:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Maintaining-formats-in-ods-excel-quot-percent-quot/m-p/325943#M17760</guid>
      <dc:creator>Imroze</dc:creator>
      <dc:date>2017-01-19T12:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining formats in ods excel "percent"</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Maintaining-formats-in-ods-excel-quot-percent-quot/m-p/325968#M17761</link>
      <description>&lt;P&gt;SAS doesn't work like Excel. &amp;nbsp;In SAS the whole column has to have the same format. &amp;nbsp;You could of course make the whole column text, then it can contain anything, but it wouldn't be numeric in the Excel file, i.e:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length pformatted $100;
  pformatted=ifc(val=0,"0",put(val,percent8,2));
run;&lt;/PRE&gt;
&lt;P&gt;Pformatted would then be the variable you print out which would contain xyz% and 0's. &amp;nbsp;Thats the simplest method I can think of. &amp;nbsp;Now you may also be able to do thi using compute blocks and call style, something like:&lt;/P&gt;
&lt;PRE&gt;proc report...;
  ...
  compute pval;
    if pval ne 0 then call define(_col_,'style','style=[tagattr="format:#,###.00%"]');
  endcomp;
run;
&lt;/PRE&gt;
&lt;P&gt;I don't have any data to test this on, but that should give some ideas.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 13:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Maintaining-formats-in-ods-excel-quot-percent-quot/m-p/325968#M17761</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-19T13:56:19Z</dc:date>
    </item>
  </channel>
</rss>

