<?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: How to keep the original numeric format while converting SAS dataset to an Excel file in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976610#M46204</link>
    <description>&lt;P&gt;Are you trying to display numbers using decimals as the thousands separator?&amp;nbsp; If so, the very hacky way to do this is to just use the PUT() function to convert to a character string.&amp;nbsp; Normally, Excel will undo this (automatically interpreting anything that looks like a number as a number), but it &lt;EM&gt;won't&lt;/EM&gt; do this in the case of a number formatted like this:&lt;/P&gt;
&lt;PRE&gt;824.586.182,15&lt;/PRE&gt;
&lt;P&gt;...assuming you're opening it in a locale where the above is not the standard.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options locale=German_Germany;

data test;
num=198481788.01;
numc=put(num, nlnum15.0);
run;

proc export data=test dbms=xlsx replace
	outfile="/home/xxxxx/testnum.xlsx";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Oct 2025 02:04:14 GMT</pubDate>
    <dc:creator>quickbluefish</dc:creator>
    <dc:date>2025-10-08T02:04:14Z</dc:date>
    <item>
      <title>How to keep the original numeric format while converting SAS dataset to an Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976604#M46202</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table cf_HYFI&amp;amp;minyear.&amp;amp;minmonth._&amp;amp;maxyear.&amp;amp;maxmonth._N_Harmony as
select    a.years as year,
          a.cie,
          a.province_cd,
          a.distribution,
          a.group as LineOfBusiness,
          a.SAS_WP_corr format=NLNUM15.0,
          a.SAS_WU_corr format=NLNUM15.0,
          b.writtenPremium format=NLNUM15.0,
          b.writtenUnit format=NLNUM15.0,
          (a.SAS_WP_corr - b.writtenPremium)*100/a.SAS_WP_corr as wp_diff format= 8.2,
          (a.SAS_WU_corr - b.writtenUnit)*100/a.SAS_WU_corr as wu_diff format= 8.2
from SAS_Summary as a
inner join harmony_trx_summ_2 as b on(a.years=put(b.accountingYear,4.) and a.cie=b.cie and a.province_cd=b.province 
and a.distribution=b.distribution and a.group=upcase(b.lineOfBusiness)) ;

quit;

libname myexcel xlsx "/finsys/bicoe/Temp/Alain/HYFIprep/cf_SAS_HYFI_N_Harmony.xlsx";

  data myexcel.cf_SAS_HYFI_N_Harmony;
  set cf_HYFI&amp;amp;minyear.&amp;amp;minmonth._&amp;amp;maxyear.&amp;amp;maxmonth._N_Harmony;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Oct 2025 22:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976604#M46202</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-10-07T22:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep the original numeric format while converting SAS dataset to an Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976607#M46203</link>
      <description>&lt;P&gt;The XLSX engine will just copy the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to be able to tell EXCEL how to display the values you can use ODS EXCEL and the STYLE attribute.&amp;nbsp; You will need to know how to specify the display format in Excel's terminology.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this blog post from a few years ago:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2022/10/21/formatting-your-microsoft-excel-output-using-ods-excel/#:~:text=Getting%20the%20desired%20formatting%20for,character%20or%20numeric%20in%20SAS" target="_blank"&gt;https://blogs.sas.com/content/sgf/2022/10/21/formatting-your-microsoft-excel-output-using-ods-excel/#:~:text=Getting%20the%20desired%20formatting%20for,character%20or%20numeric%20in%20SAS&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 23:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976607#M46203</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-10-07T23:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep the original numeric format while converting SAS dataset to an Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976610#M46204</link>
      <description>&lt;P&gt;Are you trying to display numbers using decimals as the thousands separator?&amp;nbsp; If so, the very hacky way to do this is to just use the PUT() function to convert to a character string.&amp;nbsp; Normally, Excel will undo this (automatically interpreting anything that looks like a number as a number), but it &lt;EM&gt;won't&lt;/EM&gt; do this in the case of a number formatted like this:&lt;/P&gt;
&lt;PRE&gt;824.586.182,15&lt;/PRE&gt;
&lt;P&gt;...assuming you're opening it in a locale where the above is not the standard.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options locale=German_Germany;

data test;
num=198481788.01;
numc=put(num, nlnum15.0);
run;

proc export data=test dbms=xlsx replace
	outfile="/home/xxxxx/testnum.xlsx";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Oct 2025 02:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-keep-the-original-numeric-format-while-converting-SAS/m-p/976610#M46204</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-10-08T02:04:14Z</dc:date>
    </item>
  </channel>
</rss>

