<?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: QUOTES ISSUES - while using proc export to text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543108#M150123</link>
    <description>&lt;P&gt;Yes, we send this file to downstream application with 200 character long. Right now the length is 203 because of the extra quotes added.&lt;/P&gt;
&lt;P&gt;their job will fail if we send them data more than 200 character long string.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2019 12:02:45 GMT</pubDate>
    <dc:creator>shuchidxt_gmail_com</dc:creator>
    <dc:date>2019-03-14T12:02:45Z</dc:date>
    <item>
      <title>QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542979#M150076</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 dataset into text file. when I am doing this...my text in the data look like as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="1379"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="1379"&gt;No wire activity was identified during an extended search from July-September 2018. BAU All Trans report identified minimal activity; of note was a debit for $122K stating "OFAC/Funds moved to Omnibus". UAR# 4134354&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but when it is writing to the text file it convert it to below adding quotes to the text as bold highligted&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;"No wire&lt;/STRONG&gt; activity was identified during an extended search from July-September 2018.&amp;nbsp; BAU All Trans report&amp;nbsp; identified minimal activity; of note was a debit for $122K stating&lt;STRONG&gt; ""OFAC&lt;/STRONG&gt;/Funds moved to &lt;STRONG&gt;Omnibus"".&lt;/STRONG&gt; UAR# 4134354&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 23:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542979#M150076</guid>
      <dc:creator>shuchidxt_gmail_com</dc:creator>
      <dc:date>2019-03-13T23:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542983#M150079</link>
      <description>&lt;P&gt;How did you "export" to the text file?&lt;/P&gt;
&lt;P&gt;If tried to create a delimited file then SAS used the DSD option to allow for proper protection of delimiters. So if any data item contains the delimiter then the value is enclosed in quotes.&amp;nbsp; But that means that it also need to protect values that contain the quote character itself to avoid confusion for values like:&lt;/P&gt;
&lt;PRE&gt;"hello"&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Mar 2019 00:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542983#M150079</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-14T00:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542986#M150082</link>
      <description>&lt;P&gt;I use as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc export data=out.alerts_export outfile="&amp;amp;outbound_folder_path/%lowcase(&amp;amp;case_type_cd.)_alerts_export_&amp;amp;tbl..txt" replace dbms=dlm;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;delimiter='|';&lt;BR /&gt;&amp;nbsp;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pipe delimited file&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 00:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542986#M150082</guid>
      <dc:creator>shuchidxt_gmail_com</dc:creator>
      <dc:date>2019-03-14T00:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542987#M150083</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/export.sas" target="_blank"&gt;https://github.com/scottbass/SAS/blob/master/Macro/export.sas&lt;/A&gt;, perhaps it will help?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll also need to copy&amp;nbsp;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/parmv.sas" target="_blank"&gt;https://github.com/scottbass/SAS/blob/master/Macro/parmv.sas&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The concepts are copied from&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-labels-in-proc-export-or-create-tab-dlm-file-using/m-p/76789#M8698" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-use-labels-in-proc-export-or-create-tab-dlm-file-using/m-p/76789#M8698&lt;/A&gt;, so all the smarts of the macro are due to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I just put some macro wrapper code around his code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 01:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542987#M150083</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-03-14T01:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542991#M150085</link>
      <description>So what is the solution?&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Mar 2019 02:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542991#M150085</guid>
      <dc:creator>shuchidxt_gmail_com</dc:creator>
      <dc:date>2019-03-14T02:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542992#M150086</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27156"&gt;@shuchidxt_gmail_com&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;So what is the solution?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is the problem?&amp;nbsp; That is how delimited files are SUPPOSED to be made.&lt;/P&gt;
&lt;P&gt;What are you reading it with that is not properly removing the added quoting?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 02:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/542992#M150086</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-14T02:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543108#M150123</link>
      <description>&lt;P&gt;Yes, we send this file to downstream application with 200 character long. Right now the length is 203 because of the extra quotes added.&lt;/P&gt;
&lt;P&gt;their job will fail if we send them data more than 200 character long string.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 12:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543108#M150123</guid>
      <dc:creator>shuchidxt_gmail_com</dc:creator>
      <dc:date>2019-03-14T12:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543137#M150130</link>
      <description>&lt;P&gt;&lt;STRONG&gt;What&lt;/STRONG&gt; application are you using that is misreading the file so that it thinks the value is 203 characters long?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if the downstream process is Amazon Redshift COPY command then make sure to include the CSV option so that it handles the quotes properly.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 13:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543137#M150130</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-14T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: QUOTES ISSUES - while using proc export to text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543145#M150132</link>
      <description>&lt;P&gt;If you &lt;STRONG&gt;MUST&lt;/STRONG&gt; create a file that is using a non standard format then you will probably need to create the file using a data step.&lt;/P&gt;
&lt;P&gt;But you will then have to make your own checks for how to handle values with embedded delimiters and how to handle missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you &lt;STRONG&gt;know&lt;/STRONG&gt; that your data does &lt;STRONG&gt;not&lt;/STRONG&gt; have &lt;STRONG&gt;either&lt;/STRONG&gt; of these issues then your data step could be as simple as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   set sashelp.class ;
   file log dlm='|';
   put (_all_) (:);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Replace the LOG keyword with the quoted physical name of the file you want to create. Replace SASHELP.CLASS with the name of your file.&lt;/P&gt;
&lt;P&gt;If you want the variable names added as a header row then you could just add a little more code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv temp;
proc transpose data=sashelp.class(obs=0) out=names; run;
data _null_;
  file csv dlm='|';
  set names end=eof;
  put _name_ @;
  if eof then put;
run;
data _null_;
  set sashelp.class ;
  file csv mod dlm='|';
  put (_all_) (:);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Again replace the TEMP keyword with the quoted physical name of the file you want to create.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 13:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/QUOTES-ISSUES-while-using-proc-export-to-text-file/m-p/543145#M150132</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-14T13:54:54Z</dc:date>
    </item>
  </channel>
</rss>

