<?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: libref asingment worked but when using libname refrence is wrong in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753096#M39062</link>
    <description>&lt;P&gt;Hello Bruno,&lt;/P&gt;&lt;P&gt;Thank you for your reply. This works but the reason I want to use a libname is that I need to import data from 3 years with 2 files per month so I would like to prevent typing the hole path every time. Is there a way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jul 2021 09:53:44 GMT</pubDate>
    <dc:creator>rgjpot</dc:creator>
    <dc:date>2021-07-09T09:53:44Z</dc:date>
    <item>
      <title>libref asingment worked but when using libname refrence is wrong</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753086#M39058</link>
      <description>&lt;P&gt;I tried to assingn a libref name so that i don't have to us the full pathname every time. The name is assinged but when i try to use it is does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code i used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;libname GD "H:\Mijn Documenten\Finacien\mi\Mi 2021\Glims";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc import&lt;BR /&gt;datafile = "GD\Factuur_210201_01.xls" out=glims_data_2021;&lt;BR /&gt;range="blad1$B12:0";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the log I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Libref GD was successfully assigned as follows:&lt;BR /&gt;Engine: V9&lt;BR /&gt;Physical Name: H:\Mijn Documenten\Finacien\mi\Mi 2021\Glims&lt;BR /&gt;30 run;&lt;BR /&gt;31 *importeren van de data;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;32 proc import&lt;BR /&gt;33 datafile = "GD\Factuur_210201_01.xls" out=glims_data_2021;&lt;BR /&gt;34 range="blad1$B12:0";&lt;BR /&gt;35&lt;BR /&gt;36 run;&lt;/P&gt;&lt;P&gt;ERROR: Unable to open file C:\WINDOWS\system32\GD\Factuur_210201_01.xls. It does not exist or it is already opened exclusively by another user, or you need permission to view its data.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone tell me what i do wrong. Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753086#M39058</guid>
      <dc:creator>rgjpot</dc:creator>
      <dc:date>2021-07-09T08:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: libref asingment worked but when using libname refrence is wrong</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753087#M39059</link>
      <description>&lt;P&gt;When importing Excel files using Proc IMPORT you will not use a libref, but rather a physical filename.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So change your code from&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import
datafile = "GD\Factuur_210201_01.xls" out=glims_data_2021;
range="blad1$B12:0";

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import
datafile = "&lt;SPAN&gt;H:\Mijn Documenten\Finacien\mi\Mi 2021\Glims&lt;/SPAN&gt;\Factuur_210201_01.xls" out=glims_data_2021;
range="blad1$B12:0";

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you should be fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of Proc IMPORT is a SAS dataset named glims_data_2021 in the WORK library. Where do you want to have your&amp;nbsp; SAS data set stored?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW there is no need to use a RUN; after the LIBNAME statement.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753087#M39059</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2021-07-09T09:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: libref asingment worked but when using libname refrence is wrong</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753096#M39062</link>
      <description>&lt;P&gt;Hello Bruno,&lt;/P&gt;&lt;P&gt;Thank you for your reply. This works but the reason I want to use a libname is that I need to import data from 3 years with 2 files per month so I would like to prevent typing the hole path every time. Is there a way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753096#M39062</guid>
      <dc:creator>rgjpot</dc:creator>
      <dc:date>2021-07-09T09:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: libref asingment worked but when using libname refrence is wrong</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753105#M39063</link>
      <description>&lt;P&gt;For the use case you describe, I recommend using a macro variable like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dataPath = H:\Mijn Documenten\Finacien\mi\Mi 2021\Glims;

proc import
datafile = "&amp;amp;dataPath\Factuur_210201_01.xls" out=glims_data_2021;
range="blad1$B12:0";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The %LET creates the macro variable. Macro variable just contain some text.&amp;nbsp;With &amp;amp;varname you can place the text stored in the macro variable anywhere you need it in your code.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 11:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/libref-asingment-worked-but-when-using-libname-refrence-is-wrong/m-p/753105#M39063</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2021-07-09T11:09:12Z</dc:date>
    </item>
  </channel>
</rss>

