<?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: SAS export giving double quote itself in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522530#M141878</link>
    <description>&lt;P&gt;What happened?&amp;nbsp; You asked for a delimited file and you got one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is link to Wiki Article&amp;nbsp;&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Comma-separated_values" target="_blank"&gt;https://en.wikipedia.org/wiki/Comma-separated_values&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is link to RFC 4180 that defines the standard (or as close to a standard as exists)&amp;nbsp;&lt;A href="https://tools.ietf.org/html/rfc4180&amp;nbsp;" target="_blank"&gt;https://tools.ietf.org/html/rfc4180&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just because you are using TAB instead of COMMA as the delimiter doesn't mean that the need to enclosed values that contain delimiters within quotes no longer exists. Which means that you also need to enclose values that contain quotes to avoid potential confusion.&amp;nbsp; Which then means that you need to double up the actual quotes, again to avoid confusion.&amp;nbsp; Without the quotes you could generate a file that could not be parsed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2018 14:46:15 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-12-19T14:46:15Z</dc:date>
    <item>
      <title>SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522514#M141869</link>
      <description>&lt;P&gt;I am trying to export SAS data into CSV,&amp;nbsp;sas dataset name is abc here and format is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LINE_NUMBER&lt;/TD&gt;&lt;TD&gt;DESCRIPTION&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;524JG&lt;/TD&gt;&lt;TD&gt;24PC AMEFA VINTAGE CUTLERY SET "DUBARRY"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename exprt "C:/abc.csv" encoding="utf-8";&lt;/P&gt;&lt;P&gt;proc export data=abc&lt;BR /&gt;outfile=exprt&lt;BR /&gt;dbms=tab;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LINE_NUMBER DESCRIPTION&lt;BR /&gt;&lt;SPAN&gt;524JG&lt;/SPAN&gt; "24PC AMEFA VINTAGE CUTLERY SET ""DUBARRY"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so there is double quote available before and after the description here and additional doble quote is coming after &amp;amp; before&amp;nbsp;&lt;SPAN&gt;DUBARRY word. I have no clue whats happening. Can some one help me to resolve this and make me understand what exatly happening here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 14:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522514#M141869</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2018-12-19T14:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522521#M141872</link>
      <description>&lt;P&gt;Edit, one important thing, do not name your file CSV, then use tab delimiter.&amp;nbsp; CSV stands for&amp;nbsp;&lt;STRONG&gt;Comma&lt;/STRONG&gt; Delimited Variable file, not tab delimited!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes this is standard behaviour.&amp;nbsp; If you data contains quotes, or contains the delimiter, then the whole text string needs to be enclosed within quotes, and the quotes within your data need to be increased in number.&amp;nbsp; If this was not the case, then reading that text string in, would say that "DUBARRY" should be read as a text string on its own (as quotes around string indicates that it contains the delimiter, even if in this case it doesn't).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could put out the text data yourself, using a datastep, however be aware that the output file would not be valid then (I would reject data which does not follow the basic guidance on file format).&lt;/P&gt;
&lt;P&gt;Switching to fixed width data output would also work:&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Writing-fixed-width-text-files/td-p/134975" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Writing-fixed-width-text-files/td-p/134975&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 14:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522521#M141872</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-19T14:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522530#M141878</link>
      <description>&lt;P&gt;What happened?&amp;nbsp; You asked for a delimited file and you got one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is link to Wiki Article&amp;nbsp;&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Comma-separated_values" target="_blank"&gt;https://en.wikipedia.org/wiki/Comma-separated_values&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is link to RFC 4180 that defines the standard (or as close to a standard as exists)&amp;nbsp;&lt;A href="https://tools.ietf.org/html/rfc4180&amp;nbsp;" target="_blank"&gt;https://tools.ietf.org/html/rfc4180&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just because you are using TAB instead of COMMA as the delimiter doesn't mean that the need to enclosed values that contain delimiters within quotes no longer exists. Which means that you also need to enclose values that contain quotes to avoid potential confusion.&amp;nbsp; Which then means that you need to double up the actual quotes, again to avoid confusion.&amp;nbsp; Without the quotes you could generate a file that could not be parsed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 14:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522530#M141878</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-19T14:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522889#M142008</link>
      <description>&lt;P&gt;I don't have option to ignore the file and i have to take the tab only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 15:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522889#M142008</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2018-12-20T15:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522890#M142009</link>
      <description>&lt;P&gt;What are you doing with the file?&amp;nbsp; If you want to read it into SAS or Excel or any other software that understands how delimited files are formatted you should not have any trouble.&amp;nbsp; If the software you are using does not have options for reading normally formatted delimited files then complain to the maker of that software to update their programs to be useful in the real world.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can generate a file without the quotes by writing it yourself using a data step.&amp;nbsp; You will have problems for values that contain the delimiter and also have problems with representing missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   file 'myfile.txt' dlm='09'x ;
   set have ;
   put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need column headers that is not hard either.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have(obs=0) out=names;
 var _all_;
run;
data _null_;
  file 'myfile.txt' dlm='09x' ;
  set names end=eof;
  put _name _ @;
  if eof then put;
run;
data _null_;
   file 'myfile.txt' dlm='09'x MOD ;
   set have ;
   put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2018 16:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/522890#M142009</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-20T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524580#M142658</link>
      <description>&lt;P&gt;The application which is consume this data will be developed by the Developer and they wanted to have this input in the format where we dont have any additional double quotes. So do you think you can help me the way i wanted to get an output.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524580#M142658</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-01-04T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524582#M142660</link>
      <description>&lt;P&gt;I can manage this data without double quote as Developer going to program accrodingly, if I need to provide this data in this format. Do we have any way to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524582#M142660</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-01-04T15:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS export giving double quote itself</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524594#M142666</link>
      <description>&lt;P&gt;Personally I would push back to the "developer" to support standard data formats.&amp;nbsp; If they are not then they need to provide complete specifications for how all possible data scenarios should be handled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now you can easily avoid have the embedded quotes protected by NOT using the DSD option when writing the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need more help show what you have tried and explain how it is not doing what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-export-giving-double-quote-itself/m-p/524594#M142666</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-04T16:15:54Z</dc:date>
    </item>
  </channel>
</rss>

