<?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: Getting &amp;quot;file does not exists&amp;quot; error in SAS Studio 5.1 using shpimprt in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579425#M7801</link>
    <description>Just an idea: is the pathname function able to return full filename to be passed to the macro?</description>
    <pubDate>Tue, 06 Aug 2019 15:28:33 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-08-06T15:28:33Z</dc:date>
    <item>
      <title>Getting "file does not exists" error in SAS Studio 5.1 using shpimprt</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/578187#M7778</link>
      <description>&lt;P&gt;I'm getting an error trying to use the shpimprt command to load in a .SHP file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've uploaded the file I want to import into my SAS Content folder (see attached image).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I right-clicked on the file and selected "Insert as path" to ensure i was using the correct file path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run my command to load the file, I see the following "file does not exist" error in the logs:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class="sasSource"&gt;83 %shpimprt(shapefilepath=/Users/sasdemo/tl_2018_04_sldu.shp, id="GEOID", outtable=geotest, cashost=localhost,&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84 casport=5570, caslib='casuser');&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE MAPIMPORT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Physical file does not exist, /Users/sasdemo/tl_2018_04_sldu.shp.&lt;/DIV&gt;&lt;DIV class="sasError sapUiTreeNodeSelected"&gt;ERROR: Unable to open DATAFILE.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 19:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/578187#M7778</guid>
      <dc:creator>VAinTestMode</dc:creator>
      <dc:date>2019-07-31T19:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "file does not exists" error in SAS Studio 5.1 using shpimprt</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579274#M7800</link>
      <description>&lt;P&gt;It's a little confusing, but the SAS Content tree and the server file system are two separate file stores (logical and physical, respectively).&amp;nbsp; You uploaded the .shp file to the SAS Content location, but the code is referencing (looking for, but can't find) a file path on the server file system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you have two options...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) You can access a file from a SAS Content folder directly by using a FILESRVC fileref.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename myfile FILESRVC folderpath="/Users/sasdemo" filename="&lt;SPAN&gt;tl_2018_04_sldu.shp&lt;/SPAN&gt;";&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%shpimprt(shapefilepath=myfile&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: This requires that your SAS code is capable of accepting a fileref rather than only a file path string.&amp;nbsp; Since macro parameters are just strings, I doubt the shpimprt macro will accept a fileref for the sharefilepath parameter, so probably not an option for you in this example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) You can FTP the file to your server file system (or a location it can access) and then reference that file in your SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: In SAS Studio 5.1, only the SAS Content tree is surfaced in the UI.&amp;nbsp; The server file system is not accessible from the SAS Studio 5.1 UI.&amp;nbsp; In SAS Studio 5.2, the SAS Content tree and the server file system will be accessible.&amp;nbsp; Thus, you'll be able to upload directly to either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 05:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579274#M7800</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2019-08-06T05:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "file does not exists" error in SAS Studio 5.1 using shpimprt</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579425#M7801</link>
      <description>Just an idea: is the pathname function able to return full filename to be passed to the macro?</description>
      <pubDate>Tue, 06 Aug 2019 15:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579425#M7801</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-06T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "file does not exists" error in SAS Studio 5.1 using shpimprt</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579511#M7802</link>
      <description>&lt;P&gt;I was curious, so gave it a shot, but as you'll see from this log snippet, it only returns the filename:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;76    filename myfile FILESRVC folderpath="/Users/cassmi" filename="yo.txt";
77    %put %sysfunc(pathname(myfile));
yo.txt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, there isn't really a way this (getting a path that references a file from SAS Content, but can be used in a server file system context) could work, since there is no full path to this file (in server file system context). The file doesn't exist on the server file system.&amp;nbsp; It only exists in the SAS Content location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 21:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Getting-quot-file-does-not-exists-quot-error-in-SAS-Studio-5-1/m-p/579511#M7802</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2019-08-06T21:37:43Z</dc:date>
    </item>
  </channel>
</rss>

