<?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 While export the table - Data not perfectly extract in csv file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666866#M199601</link>
    <description>&lt;P&gt;I export the table to csv format but the data is not perfectly fit in csv file.&lt;/P&gt;
&lt;P&gt;I have 100 rows in a table. When I transfer that data in csv file it has 108 rows.&lt;/P&gt;
&lt;PRE&gt;proc export data=Proj.GWAS12_Medicalhis_HTN 
outfile="D:\WFH\INSPIRED\Total_Cohort_MedicalHis_HTN.csv" dbms=csv replace;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I attach the error Image. Some remarks column extracted the text to 1st column. Help me to overcome this error.&lt;/P&gt;
&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2020 17:24:59 GMT</pubDate>
    <dc:creator>Sathish_jammy</dc:creator>
    <dc:date>2020-07-03T17:24:59Z</dc:date>
    <item>
      <title>While export the table - Data not perfectly extract in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666866#M199601</link>
      <description>&lt;P&gt;I export the table to csv format but the data is not perfectly fit in csv file.&lt;/P&gt;
&lt;P&gt;I have 100 rows in a table. When I transfer that data in csv file it has 108 rows.&lt;/P&gt;
&lt;PRE&gt;proc export data=Proj.GWAS12_Medicalhis_HTN 
outfile="D:\WFH\INSPIRED\Total_Cohort_MedicalHis_HTN.csv" dbms=csv replace;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I attach the error Image. Some remarks column extracted the text to 1st column. Help me to overcome this error.&lt;/P&gt;
&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 17:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666866#M199601</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2020-07-03T17:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: While export the table - Data not perfectly extract in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666867#M199602</link>
      <description>&lt;P&gt;Why did you post a word document with a picture of a spreadsheet when you asked SAS to generate a text file?&amp;nbsp; Why not just copy the lines from the text file and post them into the body of your question using the pop-up window you get from using the Insert Code button?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway the picture makes it look like some of the character fields in your dataset contain carriage returns and/or line feeds that is causing whatever spreadsheet program you used to open the text to interpret the values as multiple lines.&amp;nbsp; This is probably because SAS does NOT add quotes around values that contain those characters.&amp;nbsp; It only adds the quotes around values that contain the delimiter, comma in your case, or quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not just fix the data to not include those characters?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data for_export ;
  set Proj.GWAS12_Medicalhis_HTN ;
  array _c _character_ ;
  do over _c;
     _c=translate(_c,'  ','0A0D'x);
  end;
run;
proc export data=for_export  dbms=csv 
   outfile="D:\WFH\INSPIRED\Total_Cohort_MedicalHis_HTN.csv" replace
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 17:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666867#M199602</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-03T17:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: While export the table - Data not perfectly extract in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666868#M199603</link>
      <description>What makes you think it has 108 rows?&lt;BR /&gt;Are you crossing OS, ie from Unix to Windows?&lt;BR /&gt;Did you double check that no records have an extra line break in any of your text variables? If you read the data from Excel initially this is sometimes the issue. Find a record where you see the break. Check the record before it for the extra characters or any data issues. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jul 2020 17:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/While-export-the-table-Data-not-perfectly-extract-in-csv-file/m-p/666868#M199603</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-03T17:38:38Z</dc:date>
    </item>
  </channel>
</rss>

