<?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 Writing to an external file with a delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427074#M281359</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i tried to write data to an external file with a delimiter,it is writing data to the file but with no delimiter.&lt;/P&gt;&lt;P&gt;The code is as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file " &amp;amp;ctl_file " dlm='|' ;&lt;BR /&gt;put "&amp;amp;business_dt_tm" "&amp;amp;business_dt_tm" "&amp;amp;extract_dt_tm" "&amp;amp;extract_dt_tm" "&amp;amp;rec_count" "&amp;amp;sequencenum";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's wrong with the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Swathi&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2018 00:41:55 GMT</pubDate>
    <dc:creator>sfffdg</dc:creator>
    <dc:date>2018-01-12T00:41:55Z</dc:date>
    <item>
      <title>Writing to an external file with a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427074#M281359</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i tried to write data to an external file with a delimiter,it is writing data to the file but with no delimiter.&lt;/P&gt;&lt;P&gt;The code is as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file " &amp;amp;ctl_file " dlm='|' ;&lt;BR /&gt;put "&amp;amp;business_dt_tm" "&amp;amp;business_dt_tm" "&amp;amp;extract_dt_tm" "&amp;amp;extract_dt_tm" "&amp;amp;rec_count" "&amp;amp;sequencenum";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's wrong with the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Swathi&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 00:41:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427074#M281359</guid>
      <dc:creator>sfffdg</dc:creator>
      <dc:date>2018-01-12T00:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an external file with a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427083#M281360</link>
      <description>&lt;P&gt;You are writing text, not data, So the text is written as is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data _null_;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;file " &amp;amp;ctl_file " dlm='|' ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;put&amp;nbsp;VAR1 VAR2 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;will use the delimiter&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 01:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427083#M281360</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-01-12T01:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an external file with a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427089#M281361</link>
      <description>&lt;P&gt;The PUT statement will not write delimiters between string literals.&amp;nbsp; Either include the delimiter in the strings,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file "&amp;amp;ctl_file" dsd dlm='|' ;
  put "&amp;amp;business_dt_tm|&amp;amp;business_dt_tm|&amp;amp;extract_dt_tm" 
       "|&amp;amp;extract_dt_tm|&amp;amp;rec_count|&amp;amp;sequencenum"
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or put the strings into a variable and write the variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file "&amp;amp;ctl_file" dsd dlm='|' ;
  length name $100 ;
  do name = "&amp;amp;business_dt_tm" ,"&amp;amp;business_dt_tm", "&amp;amp;extract_dt_tm" 
           ,"&amp;amp;extract_dt_tm", "&amp;amp;rec_count", "&amp;amp;sequencenum"
  ;
    put name @ ;
  end;
  put;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also don't put spaces at the beginning and end of your filenames. You will have a real hard time referencing those files again!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 02:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427089#M281361</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-12T02:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an external file with a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427104#M281362</link>
      <description>&lt;P&gt;Thank you Sir!!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 04:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-an-external-file-with-a-delimiter/m-p/427104#M281362</guid>
      <dc:creator>sfffdg</dc:creator>
      <dc:date>2018-01-12T04:31:53Z</dc:date>
    </item>
  </channel>
</rss>

