<?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 data to a csv file without spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56632#M12127</link>
    <description>How do I write data to a semicolon sepr. file with no spaces before the semicolon?&lt;BR /&gt;
&lt;BR /&gt;
the code (example)&lt;BR /&gt;
&lt;BR /&gt;
data _null_&lt;BR /&gt;
file "c:\temp\file.csv";&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
put name';'sex ';'age;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
gives the result (please notice the spaces before the semicolon)&lt;BR /&gt;
&lt;BR /&gt;
Alfred ;M ;14&lt;BR /&gt;
Alice ;F ;13&lt;BR /&gt;
Barbara ;F ;13&lt;BR /&gt;
Carol ;F ;14&lt;BR /&gt;
Henry ;M ;14&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Should it alle be put in to a compressed string or what?&lt;BR /&gt;
The case is complicated by the fact that char.vars should be in quotes in the output as in this example (but still with no spaces):&lt;BR /&gt;
&lt;BR /&gt;
"Alfred" ;"M" ;14&lt;BR /&gt;
"Alice" ;"F" ;13&lt;BR /&gt;
"Barbara" ;"F" ;13&lt;BR /&gt;
"Carol" ;"F" ;14&lt;BR /&gt;
"Henry" ;"M" ;14</description>
    <pubDate>Thu, 23 Oct 2008 15:14:23 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-10-23T15:14:23Z</dc:date>
    <item>
      <title>Writing data to a csv file without spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56632#M12127</link>
      <description>How do I write data to a semicolon sepr. file with no spaces before the semicolon?&lt;BR /&gt;
&lt;BR /&gt;
the code (example)&lt;BR /&gt;
&lt;BR /&gt;
data _null_&lt;BR /&gt;
file "c:\temp\file.csv";&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
put name';'sex ';'age;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
gives the result (please notice the spaces before the semicolon)&lt;BR /&gt;
&lt;BR /&gt;
Alfred ;M ;14&lt;BR /&gt;
Alice ;F ;13&lt;BR /&gt;
Barbara ;F ;13&lt;BR /&gt;
Carol ;F ;14&lt;BR /&gt;
Henry ;M ;14&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Should it alle be put in to a compressed string or what?&lt;BR /&gt;
The case is complicated by the fact that char.vars should be in quotes in the output as in this example (but still with no spaces):&lt;BR /&gt;
&lt;BR /&gt;
"Alfred" ;"M" ;14&lt;BR /&gt;
"Alice" ;"F" ;13&lt;BR /&gt;
"Barbara" ;"F" ;13&lt;BR /&gt;
"Carol" ;"F" ;14&lt;BR /&gt;
"Henry" ;"M" ;14</description>
      <pubDate>Thu, 23 Oct 2008 15:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56632#M12127</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-23T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Writing data to a csv file without spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56633#M12128</link>
      <description>Try&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set sashelp.class;&lt;BR /&gt;
  file "c:\temp\file.csv" dsd;&lt;BR /&gt;
  put name +(-1) ';' sex +(-1) ';' age;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 23 Oct 2008 16:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56633#M12128</guid>
      <dc:creator>GertNissen</dc:creator>
      <dc:date>2008-10-23T16:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Writing data to a csv file without spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56634#M12129</link>
      <description>Thanks, &lt;BR /&gt;
&lt;BR /&gt;
The lesson must be "RTFM" :-))</description>
      <pubDate>Fri, 24 Oct 2008 07:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56634#M12129</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-24T07:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Writing data to a csv file without spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56635#M12130</link>
      <description>Geniz is right but not making full use of SAS.  Try&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   file "c:\temp\file.csv" dsd dlm=";" ; &lt;BR /&gt;
   put name  sex age;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
SAS allows you to specify the delimitter to use with the DSD.  Makes life very easy.</description>
      <pubDate>Fri, 24 Oct 2008 14:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-data-to-a-csv-file-without-spaces/m-p/56635#M12130</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-24T14:22:22Z</dc:date>
    </item>
  </channel>
</rss>

