<?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: Data set import: File name has space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581506#M165287</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277351"&gt;@jerrylshen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pre "C:folder name";

%let ds1="File Name Has Space(s)";  
/*File is .xlsx */

data old;
	set pre.&amp;amp;ds1.; 
        /*Error here with the file name */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did a quick google search, I saw several that mentions Pipe, which I assume it doesn't really apply to me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is the file a SAS dataset, like your last step is assuming.&amp;nbsp; Or is it an XLSX file, like your comment says?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use a dataset name that includes a space (why would you want to?) you need to set the VALIDMEMNAME option to extend and use a name literal.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validmemname=extend ;
proc print data=pre."name with space"n ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To read from an XLSX file you can use PROC IMPORT or the XLSX libname engine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pre xlsx 'name of the xlsx file';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2019 17:02:15 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-08-15T17:02:15Z</dc:date>
    <item>
      <title>Data set import: File name has space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581473#M165271</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pre "C:folder name";

%let ds1="File Name Has Space(s)";  
/*File is .xlsx */

data old;
	set pre.&amp;amp;ds1.; 
        /*Error here with the file name */
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I did a quick google search, I saw several that mentions Pipe, which I assume it doesn't really apply to me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: turns out its a .CSV file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n02nz0e7cykqhun14hcppfmd0558.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n02nz0e7cykqhun14hcppfmd0558.htm&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this helped.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 17:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581473#M165271</guid>
      <dc:creator>jerrylshen</dc:creator>
      <dc:date>2019-08-15T17:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data set import: File name has space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581476#M165272</link>
      <description>&lt;P&gt;If your file is .xlsx then the data step is not the way to go. Use PROC IMPORT instead. Do a Google search, thousands of examples out there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 15:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581476#M165272</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-15T15:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data set import: File name has space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581483#M165273</link>
      <description>Spaces in file names are not issues in SAS. &lt;BR /&gt;&lt;BR /&gt;Your code is wrong (syntax is incorrect), which is the issue. Make sure it first works without macro variables and then add macro variables.</description>
      <pubDate>Thu, 15 Aug 2019 16:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581483#M165273</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-15T16:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data set import: File name has space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581506#M165287</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277351"&gt;@jerrylshen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pre "C:folder name";

%let ds1="File Name Has Space(s)";  
/*File is .xlsx */

data old;
	set pre.&amp;amp;ds1.; 
        /*Error here with the file name */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did a quick google search, I saw several that mentions Pipe, which I assume it doesn't really apply to me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is the file a SAS dataset, like your last step is assuming.&amp;nbsp; Or is it an XLSX file, like your comment says?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use a dataset name that includes a space (why would you want to?) you need to set the VALIDMEMNAME option to extend and use a name literal.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validmemname=extend ;
proc print data=pre."name with space"n ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To read from an XLSX file you can use PROC IMPORT or the XLSX libname engine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pre xlsx 'name of the xlsx file';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 17:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-set-import-File-name-has-space/m-p/581506#M165287</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-15T17:02:15Z</dc:date>
    </item>
  </channel>
</rss>

