<?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 dsd option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dsd-option/m-p/349451#M81051</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the sample code for file creation. When I use DSD option in the file statement, it is putting double quotes around field A in the output file whereas without DSD option it gives an extra space for missing fields. Any one has a solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fieldval|newfield|new| |1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"fieldval|newfield"|new||1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Its putting double quotes because your delimiter is a pipe and your Field A also has a pipe. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;options missing='';&lt;BR /&gt;data one;&lt;BR /&gt;a='fieldval|newfield';&lt;BR /&gt;b='new';&lt;BR /&gt;c='';&lt;BR /&gt;d='1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;filename outfile "/uhome/snoone/test.txt" ;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set one;&lt;/P&gt;
&lt;P&gt;file outfile DELIMITER='|' dropover dsd lrecl=1000;&lt;BR /&gt;put a&lt;BR /&gt; b&lt;BR /&gt; c&lt;BR /&gt; d;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2017 13:46:48 GMT</pubDate>
    <dc:creator>helloSAS</dc:creator>
    <dc:date>2017-04-12T13:46:48Z</dc:date>
    <item>
      <title>dsd option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dsd-option/m-p/349451#M81051</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the sample code for file creation. When I use DSD option in the file statement, it is putting double quotes around field A in the output file whereas without DSD option it gives an extra space for missing fields. Any one has a solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fieldval|newfield|new| |1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"fieldval|newfield"|new||1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Its putting double quotes because your delimiter is a pipe and your Field A also has a pipe. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;options missing='';&lt;BR /&gt;data one;&lt;BR /&gt;a='fieldval|newfield';&lt;BR /&gt;b='new';&lt;BR /&gt;c='';&lt;BR /&gt;d='1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;filename outfile "/uhome/snoone/test.txt" ;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set one;&lt;/P&gt;
&lt;P&gt;file outfile DELIMITER='|' dropover dsd lrecl=1000;&lt;BR /&gt;put a&lt;BR /&gt; b&lt;BR /&gt; c&lt;BR /&gt; d;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 13:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dsd-option/m-p/349451#M81051</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2017-04-12T13:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: dsd option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dsd-option/m-p/349460#M81052</link>
      <description>&lt;P&gt;Sorry, what is the question here, you seem to have your answer?&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;Its putting double quotes because your delimiter is a pipe and your Field A also has a pipe. &amp;nbsp;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If your data contains the delimiter, then it has to quote the string otherwise delimeters will get messed up. &amp;nbsp;Sort your input dataset out:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data one;&lt;BR /&gt;&amp;nbsp; a1='fieldval';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; a2='newfield';&lt;BR /&gt;&amp;nbsp; b='new';&lt;BR /&gt;&amp;nbsp; c='';&lt;BR /&gt;&amp;nbsp; d='1';&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And the problem will go away.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Edit: Alternatively change your delimiter. &amp;nbsp;The point about delimited files is that the delimiter&amp;nbsp;&lt;STRONG&gt;only&amp;nbsp;&lt;/STRONG&gt;appears between data items.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 14:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dsd-option/m-p/349460#M81052</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-12T14:08:30Z</dc:date>
    </item>
  </channel>
</rss>

