<?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: No option in Base SAS to define the encoding when saving data as a csv file in proc export in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498858#M132647</link>
    <description>&lt;P&gt;Thanks a lot. This worked!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Sep 2018 20:28:56 GMT</pubDate>
    <dc:creator>sreevatsan1991</dc:creator>
    <dc:date>2018-09-25T20:28:56Z</dc:date>
    <item>
      <title>No option in Base SAS to define the encoding when saving data as a csv file in proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498851#M132643</link>
      <description>&lt;P&gt;When I try to read the csv file saved by SAS into python, I am getting unicode-decode error. The error was because of '0x80' character available in the file. it can be solved by explicitly defining the encoding when reading the file. But I need to solve it to in SAS while creating the .csv file.&lt;/P&gt;&lt;P&gt;Is there a way to define the encoding in the proc export code like (encoding='utf-8' etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code :&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA= data1&lt;BR /&gt;OUTFILE= "F:\reports\&amp;amp;file_name..csv"&lt;BR /&gt;DBMS=CSV REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498851#M132643</guid>
      <dc:creator>sreevatsan1991</dc:creator>
      <dc:date>2018-09-25T20:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: No option in Base SAS to define the encoding when saving data as a csv file in proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498853#M132644</link>
      <description>&lt;P&gt;Did you try using a fileref?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv "F:\reports\&amp;amp;file_name..csv" encoding='utf-8';
PROC EXPORT DATA= data1 REPLACE
  OUTFILE= CSV DBMS=CSV 
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498853#M132644</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-09-25T20:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: No option in Base SAS to define the encoding when saving data as a csv file in proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498856#M132646</link>
      <description>&lt;P&gt;Try assigning a FILEREF to the output data set and set the encoding there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfile 'paht to file' encoding=....;

proc export data=data outfile=myfile dbms=csv replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/231626"&gt;@sreevatsan1991&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I try to read the csv file saved by SAS into python, I am getting unicode-decode error. The error was because of '0x80' character available in the file. it can be solved by explicitly defining the encoding when reading the file. But I need to solve it to in SAS while creating the .csv file.&lt;/P&gt;
&lt;P&gt;Is there a way to define the encoding in the proc export code like (encoding='utf-8' etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code :&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA= data1&lt;BR /&gt;OUTFILE= "F:\reports\&amp;amp;file_name..csv"&lt;BR /&gt;DBMS=CSV REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498856#M132646</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-25T20:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: No option in Base SAS to define the encoding when saving data as a csv file in proc export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498858#M132647</link>
      <description>&lt;P&gt;Thanks a lot. This worked!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-option-in-Base-SAS-to-define-the-encoding-when-saving-data-as/m-p/498858#M132647</guid>
      <dc:creator>sreevatsan1991</dc:creator>
      <dc:date>2018-09-25T20:28:56Z</dc:date>
    </item>
  </channel>
</rss>

