<?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: Export SAS Datasets as a .CSV File with a dash in the input file name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461797#M284839</link>
    <description>&lt;P&gt;Thank you Kurt! I'll give that a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive CSV files from an external party / system that exists for many years (running Windows) and the files come with all sorts of file names that I cannot control (nor it is feasible to change such an old system), so I need to read them however they are named.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 May 2018 20:02:46 GMT</pubDate>
    <dc:creator>the_yeti</dc:creator>
    <dc:date>2018-05-12T20:02:46Z</dc:date>
    <item>
      <title>Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461784#M284837</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm following the steps in &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-Export-SAS-Datasets-as-a-CSV-File-in-SAS-University/ta-p/441569" target="_self"&gt;How to Export SAS Datasets as a .CSV File in SAS University Edition&lt;/A&gt;&amp;nbsp;to export a CSV file from a SAS dataset, with something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname example "/folders/myfolders";
run;

proc export data=example.Example-Data
  outfile='/folders/myfolders/ExampleCSV.csv'
  dbms=csv
  replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, my input file has a dash in it e.g. the file is called `Example-Data.sas7bdat`.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS give me an error because "-" (dash) is not allowed in variable names. I'm not able to rename the file, so I need a way to tell SAS to get the file name from a string, instead of a variable name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 18:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461784#M284837</guid>
      <dc:creator>the_yeti</dc:creator>
      <dc:date>2018-05-12T18:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461788#M284838</link>
      <description>&lt;P&gt;Dashes are not allowed in valid SAS names. You could work around by setting&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data=example.'Example-Data'n&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I strongly, and I mean&amp;nbsp;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;STRONGLY,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt; recommend to rename the .sas7bdat file from the commandline and to work with standard SAS names.&lt;/P&gt;
&lt;P&gt;How was the dataset created in the first place? Fix the mistake there.&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 19:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461788#M284838</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-12T19:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461797#M284839</link>
      <description>&lt;P&gt;Thank you Kurt! I'll give that a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive CSV files from an external party / system that exists for many years (running Windows) and the files come with all sorts of file names that I cannot control (nor it is feasible to change such an old system), so I need to read them however they are named.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 20:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461797#M284839</guid>
      <dc:creator>the_yeti</dc:creator>
      <dc:date>2018-05-12T20:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461800#M284840</link>
      <description>&lt;P&gt;&lt;EM&gt;External files&amp;nbsp;&lt;/EM&gt;(like csv's) can have any name that the OS supports.&amp;nbsp;&lt;EM&gt;SAS datasets&lt;/EM&gt; need to adhere to valid SAS names. If you always receive data in csv format,&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; set the dataset names when importing.&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461800#M284840</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-12T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461810#M284841</link>
      <description>&lt;P&gt;The name of the SAS data set has nothing to do with the name of the original csv files. I understand not changing processes, but this is known as technical debt and you need to start somewhere. At least moving forward, make sure you don't continue this practice.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189301"&gt;@the_yeti&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Kurt! I'll give that a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I receive CSV files from an external party / system that exists for many years (running Windows) and the files come with all sorts of file names that I cannot control (nor it is feasible to change such an old system), so I need to read them however they are named.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 May 2018 02:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461810#M284841</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-13T02:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS Datasets as a .CSV File with a dash in the input file name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461825#M284842</link>
      <description>&lt;P&gt;filename with a dash is illegal name in sas.&lt;/P&gt;
&lt;P&gt;1) rename it as a legal name.&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;options&amp;nbsp; validmemname=extend ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;export&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;ex&lt;/SPAN&gt;ample&lt;SPAN class="token punctuation"&gt;.'&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;Ex&lt;/SPAN&gt;ample&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;Data'n&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 May 2018 10:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-SAS-Datasets-as-a-CSV-File-with-a-dash-in-the-input-file/m-p/461825#M284842</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-05-13T10:38:35Z</dc:date>
    </item>
  </channel>
</rss>

