<?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: loss of formatted values in the exported CSV file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200175#M266742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You aren't losing the format in your csv, if you open the csv in excel or another spreadsheet application that is where you are losing your format.&amp;nbsp; Test exporting then importing the csv, the formats will hold.&amp;nbsp; The problem is with your spreadsheet.&amp;nbsp; Try ods, here is a template that I use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP path='PATH' file='OUTPUT.xml'&lt;/P&gt;&lt;P&gt;style=printer;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='SHEET NAME ONE' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=FILE1 noobs;&lt;/P&gt;&lt;P&gt;var var1 var2 / style(column)={tagattr='Format:@'}; /* format as character for leading zeros */&lt;/P&gt;&lt;P&gt;var var3 var4 / style={tagattr='Format:#,###'};run;quit; /* format comma */&lt;/P&gt;&lt;P&gt;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='SHEET NAME TWO' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=FILE2 noobs;&lt;/P&gt;&lt;P&gt;var _all_;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 17:36:05 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-07-10T17:36:05Z</dc:date>
    <item>
      <title>loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200171#M266738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to export my SAS data set to an external file that is readable to my clients. To do so, the file should use labels as column names and contain the formatted values. With the following program, the first purpose has been achieved. Unfortunately, some values are lost in the exported CSV. In the SAS data set, these values have the format of Percent5.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my program:&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14365402400229734"&gt;
&lt;P&gt;proc export&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data= data_pro.table01_row1_to_row9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile= "&amp;amp;dir_project.\&amp;amp;output_folder.\NIS_colon_table01_b.csv"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms= CSV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; putnames= yes;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if labels and formatted values can be also export to other file formats, such as MS Access or Excel. I am not sure why it is currently now allowed to attach such file type as .CSV, .sas7bat or .zip. Please download the SAS dataset and the exported CSV at this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://likecoded.com/sas/loss-of-formatted-values-in-the-exported-csv-file/" title="http://likecoded.com/sas/loss-of-formatted-values-in-the-exported-csv-file/"&gt;loss of formatted values in the exported CSV file | Like-Minded Data Analysts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200171#M266738</guid>
      <dc:creator>Chang</dc:creator>
      <dc:date>2015-07-10T15:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200172#M266739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Formatted values are exported in CSV by default. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What version of SAS are you on?&amp;nbsp; What type of format isn't working for you, all or one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formats aren't allowed for Excel, they can be attached to sas7bdat but then the system needs a file that also defines the custom format as format definitions are not store in the file.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're viewing your CSV file in Excel, Excel may do it's own interpretation so make sure to view the file in a text editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the following not work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value age_cat&lt;/P&gt;&lt;P&gt;0-12 = 'Child'&lt;/P&gt;&lt;P&gt;12-14 = 'Teen'&lt;/P&gt;&lt;P&gt;14-high='Adult';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;format age age_cat.;&lt;/P&gt;&lt;P&gt;label age='Age Category' weight='Weight(lbs)';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc export data=class outfile="C:\temp\outtest.csv" Label dbms=csv replace; putnames=yes;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200172#M266739</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-10T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200173#M266740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By lost do you mean they are not in the data or that the appearance is unformatted such as .012 instead of 1.2%?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also try ODS CSV with proc print and the NOOBS and LABEL options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you mean readable by people and not needed to be read as data for another program any of the report procedures and RTF or PDF might be acceptable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200173#M266740</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-10T15:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200174#M266741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using ODS Tagsets is also a great option that I like, people are familiar with Excel. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html" title="http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html"&gt;Base SAS: Demo: ExcelXP Tagset and Microsoft Excel&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 16:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200174#M266741</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-10T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200175#M266742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You aren't losing the format in your csv, if you open the csv in excel or another spreadsheet application that is where you are losing your format.&amp;nbsp; Test exporting then importing the csv, the formats will hold.&amp;nbsp; The problem is with your spreadsheet.&amp;nbsp; Try ods, here is a template that I use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP path='PATH' file='OUTPUT.xml'&lt;/P&gt;&lt;P&gt;style=printer;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='SHEET NAME ONE' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=FILE1 noobs;&lt;/P&gt;&lt;P&gt;var var1 var2 / style(column)={tagattr='Format:@'}; /* format as character for leading zeros */&lt;/P&gt;&lt;P&gt;var var3 var4 / style={tagattr='Format:#,###'};run;quit; /* format comma */&lt;/P&gt;&lt;P&gt;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP options(sheet_name='SHEET NAME TWO' AUTOFILTER = 'ALL');&lt;/P&gt;&lt;P&gt;proc print data=FILE2 noobs;&lt;/P&gt;&lt;P&gt;var _all_;run;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.ExcelXP close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 17:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200175#M266742</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-10T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200176#M266743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your width is too small in your export. Try something wider than percent5.2, perhaps percent8.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 15:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200176#M266743</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-13T15:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200177#M266744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're not quite understanding the percent format.&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000205182.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000205182.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your values are over 1, so 3.45, which I'm assuming you intend as 3.45%. SAS would present this as 345.55% which is why it's running out of digits. You can either scale your numbers to less than 100 or you can use a custom format.&lt;/P&gt;&lt;P&gt;Here's a custom format, but it rounds differently that you might expect. I'm sure there's a way to correct that, but I'll leave that to you. The new, scaled variables are at the end of the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format; &lt;/P&gt;&lt;P&gt;&amp;nbsp; picture mypct low-high='000,009.99%'; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set test.table01_row1_to_row9:;&lt;/P&gt;&lt;P&gt;format _numeric_ best12.;&lt;/P&gt;&lt;P&gt;dead_pct2=dead_pct/100;&lt;/P&gt;&lt;P&gt;female_pct2=female_pct/100;&lt;/P&gt;&lt;P&gt;format dead_pct2 female_pct2 percent8.2;&lt;/P&gt;&lt;P&gt;format dead_pct female_pct mypct.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc export&lt;/P&gt;&lt;P&gt;&amp;nbsp; data= test&lt;/P&gt;&lt;P&gt;&amp;nbsp; outfile= "C:\_LocalData\NIS_colon_table01_V2.csv"&lt;/P&gt;&lt;P&gt;&amp;nbsp; dbms= CSV&lt;/P&gt;&lt;P&gt;&amp;nbsp; label&lt;/P&gt;&lt;P&gt;&amp;nbsp; replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; putnames= yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 17:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200177#M266744</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-13T17:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200178#M266745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. To answer your questions, I am running SAS 9.3 on 64 bits Windows 7. Yes, the format in your program is working well on my side. The age variable is in a format similar to what is specified in the PROC FORMAT. The values are Teen, Child, or Adult, whether the CSV is opened in Excel or Notepad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Values in the format of comma8., 5.2 and 4.2 are shown correctly in my CSV file. Values in the format of Percent4.2 or Percent5.2, on the other hand, are shown as *% or **%. My formats are specified in the PROC SQL. I have pasted my full program and data from my CSV below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my SAS program:&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14368457696733928" jivemacro_uid="_14368457696733928"&gt;
&lt;P&gt;/*----------------merge row 1 to row 9 by year-------------*/&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table data_pro.table01_row1_to_row9 as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,a.num_hosp_wt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= comma8.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Number of hospitalization'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.dead_pct&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= Percent5.2&amp;nbsp;&amp;nbsp;&amp;nbsp; label='died(%)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,c.num_PR_wt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= comma8.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Number of procedures'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,d.age_mean_wt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= 5.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Mean age'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,e.female_pct&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= Percent5.2&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Female(%)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,f.mean_CCXscore_wt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= 4.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label='mean combined comorbidity score'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,g.Percent as urban_pct&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= Percent5.2&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Urban hospital(%)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,h.Percent as rural_nonteach_pct&amp;nbsp;&amp;nbsp;&amp;nbsp; format= Percent5.2&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Rural non-teaching hospital(%)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,i.Percent as rural_teach_pct&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format= Percent5.2&amp;nbsp;&amp;nbsp;&amp;nbsp; label='Rural teaching hospital(%)'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_01 as a,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_02&amp;nbsp;&amp;nbsp;&amp;nbsp; as b,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_03 as c,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_04 as d,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_05 as e,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_06 as f,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_07 as g,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_08 as h,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_pro.table01_row_09 as i&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp; a.year=b.year=c.year=d.year=e.year=f.year=g.year=h.year=i.year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by a.year;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;proc export&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data= data_pro.table01_row1_to_row9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile= "&amp;amp;dir_project.\&amp;amp;output_folder.\NIS_colon_table01.csv" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms= CSV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; putnames= yes;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;CSV opened in Notepad:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Calendar year","Number of hospitalization","died(%)","Number of procedures","Mean age","Female(%)","mean combined comorbidity score","Urban hospital(%)","Rural non-teaching hospital(%)","Rural teaching hospital(%)"&lt;/P&gt;&lt;P&gt;2004,"94,626",*%,"333,298",69.80,**%,3.66,**%,**%,**%&lt;/P&gt;&lt;P&gt;2005,"93,858",*%,"339,726",69.90,**%,3.61,**%,**%,**%&lt;/P&gt;&lt;P&gt;2006,"58,008",*%,"216,229",70.18,**%,3.73,**%,**%,**%&lt;/P&gt;&lt;P&gt;2007,"91,827",*%,"340,850",69.33,**%,3.59,**%,**%,**%&lt;/P&gt;&lt;P&gt;2008,"85,115",*%,"321,637",69.54,**%,3.62,**%,**%,**%&lt;/P&gt;&lt;P&gt;2009,"59,684",*%,"250,416",69.55,**%,4.01,**%,**%,**%&lt;/P&gt;&lt;P&gt;2010,"55,346",*%,"240,234",69.41,**%,4.08,**%,**%,**%&lt;/P&gt;&lt;P&gt;2011,"55,499",*%,"238,977",69.38,**%,4.15,**%,**%,**%&lt;/P&gt;&lt;P&gt;2012,"51,310",*%,"221,750",69.11,**%,4.17,**%,**%,**%&lt;/P&gt;&lt;P&gt;2013,"645,273",*%,2503116,69.60,**%,3.79,**%,**%,**%&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 03:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200178#M266745</guid>
      <dc:creator>Chang</dc:creator>
      <dc:date>2015-07-14T03:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200179#M266746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please look at the examples in the percent documentation in my link above. &lt;/P&gt;&lt;P&gt;Your raw data set shows your numbers as 3.4525 for example. Applying a percent format would make the number 345.25% which requires a width of 8.2, so using a format of percent8.2 would generate the value 345.25%. However, I &lt;EM&gt;think &lt;/EM&gt;that your actual value is 3.45%. Please run my code above on your data and let me know if it works properly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 03:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200179#M266746</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-14T03:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: loss of formatted values in the exported CSV file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200180#M266747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not aware that the values were larger than 1. I have replaced the format with format=7.2. It is working well. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 04:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loss-of-formatted-values-in-the-exported-CSV-file/m-p/200180#M266747</guid>
      <dc:creator>Chang</dc:creator>
      <dc:date>2015-07-14T04:15:43Z</dc:date>
    </item>
  </channel>
</rss>

