<?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: Proc Export CSV Still Seeing Commas as Delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934428#M367449</link>
    <description>&lt;P&gt;I am verifying the contents of the CSV file in Excel.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 16:10:42 GMT</pubDate>
    <dc:creator>shu1225</dc:creator>
    <dc:date>2024-07-02T16:10:42Z</dc:date>
    <item>
      <title>Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934408#M367438</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to export a very large dataset from SAS to CSV using "|" as my delimiter. I'm using the code as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;filename output "filepath" encoding="UTF-8";&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc export data = dataset&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outfile = output&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbms = csv replace;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;delimiter="|";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, some of the fields in the dataset contain commas and they are still being read as delimiters in the CSV files, causing columns to be broken up. Is there another way the delimiter needs to be coded to make sure commas are not read as delimiters?&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934408#M367438</guid>
      <dc:creator>shu1225</dc:creator>
      <dc:date>2024-07-02T15:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934413#M367440</link>
      <description>&lt;P&gt;I'm not understanding the issue. Here is sample code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	infile datalines dsd dlm='|';
	input Text1:$30. Text2:$30. Num1:32.; 
datalines;
Now is the time|for all good men|1
Now, it's the time|for all, good men|2
A,B,C,D|E,F,G,H|3
;

filename output "test.dlm" encoding="UTF-8";

proc export data = test
	outfile = output
	dbms = csv replace;
	delimiter="|";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which produces this result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Text1|Text2|Num1
Now is the time|for all good men|1
Now, it's the time|for all, good men|2
A,B,C,D|E,F,G,H|3
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is what I would expect. What were you expecting instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934413#M367440</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-07-02T15:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934415#M367442</link>
      <description>&lt;P&gt;That is also what I would have expected. However, what I'm getting is this:&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;Text1|Text2|Num1
Now is the time|for all good men|1
Now| it's the time|for all| good men|2
A|B|C|D|E|F|G|H|3&lt;/LI-CODE&gt;&lt;P&gt;All commas are still being read as delimiters.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934415#M367442</guid>
      <dc:creator>shu1225</dc:creator>
      <dc:date>2024-07-02T15:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934421#M367446</link>
      <description>&lt;P&gt;I just ran this and got the results I showed you. Can you please run the test program above in a fresh SAS session and then share the complete log?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934421#M367446</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-07-02T15:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934422#M367447</link>
      <description>You say 'being read' are you reimporting the file somehow? How are you verifying the file contents?</description>
      <pubDate>Tue, 02 Jul 2024 15:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934422#M367447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-07-02T15:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934428#M367449</link>
      <description>&lt;P&gt;I am verifying the contents of the CSV file in Excel.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 16:10:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934428#M367449</guid>
      <dc:creator>shu1225</dc:creator>
      <dc:date>2024-07-02T16:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934436#M367452</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466986"&gt;@shu1225&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am verifying the contents of the CSV file in Excel.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do not use Excel to check the contents of a TEXT file.&amp;nbsp; Use a TEXT Editor instead, like Notepad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you tell Excel to open the file?&amp;nbsp; If you let Excel open a file with a .CSV extension by default it will assume the delimiter is a comma.&amp;nbsp; Instead first open Excel and then use the file import tool to read the file.&amp;nbsp; They keep moving that around in the menu's but in my current version of Excel it is under Data -&amp;gt; Get Data -&amp;gt; From File -&amp;gt; From Text/CSV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1719938199551.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98088i7E1331FA65AD9EF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1719938199551.png" alt="Tom_0-1719938199551.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which should then let you pick a file and pop-up with a screen where YOU can TELL Excel what delimiter to use.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1719938334248.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98089iA8E84E908340C5BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_1-1719938334248.png" alt="Tom_1-1719938334248.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 16:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934436#M367452</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-07-02T16:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export CSV Still Seeing Commas as Delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934437#M367453</link>
      <description>&lt;P&gt;I did not have Notepad on the laptop I was using. I had input it the way you mentioned for Excel but forgot to check that I needed a custom delimiter. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 16:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-CSV-Still-Seeing-Commas-as-Delimiter/m-p/934437#M367453</guid>
      <dc:creator>shu1225</dc:creator>
      <dc:date>2024-07-02T16:43:00Z</dc:date>
    </item>
  </channel>
</rss>

