<?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 Work in the current directory in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75238#M21810</link>
    <description>Hi everybody!&lt;BR /&gt;
&lt;BR /&gt;
I would like to define a SAS library in a folder inside the current folder where I am working.&lt;BR /&gt;
&lt;BR /&gt;
For example the program Import_data.sas is located in c:\temp. This program imports some datasets and I would like to save them in c:\temp\data.&lt;BR /&gt;
&lt;BR /&gt;
I would like to do something like we do in html&lt;BR /&gt;
&lt;BR /&gt;
libname data '.\data';&lt;BR /&gt;
&lt;BR /&gt;
where "." means the current directory where the program is located.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help!!&lt;BR /&gt;
Juanvte</description>
    <pubDate>Fri, 09 Oct 2009 08:54:02 GMT</pubDate>
    <dc:creator>JuanVte</dc:creator>
    <dc:date>2009-10-09T08:54:02Z</dc:date>
    <item>
      <title>Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75238#M21810</link>
      <description>Hi everybody!&lt;BR /&gt;
&lt;BR /&gt;
I would like to define a SAS library in a folder inside the current folder where I am working.&lt;BR /&gt;
&lt;BR /&gt;
For example the program Import_data.sas is located in c:\temp. This program imports some datasets and I would like to save them in c:\temp\data.&lt;BR /&gt;
&lt;BR /&gt;
I would like to do something like we do in html&lt;BR /&gt;
&lt;BR /&gt;
libname data '.\data';&lt;BR /&gt;
&lt;BR /&gt;
where "." means the current directory where the program is located.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help!!&lt;BR /&gt;
Juanvte</description>
      <pubDate>Fri, 09 Oct 2009 08:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75238#M21810</guid>
      <dc:creator>JuanVte</dc:creator>
      <dc:date>2009-10-09T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75239#M21811</link>
      <description>From the LIBNAME documentation, there is no provision for what you are asking.  Your &lt;LIBREF&gt; allocation effect makes no "PWD" or current drive/directory assumptions.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS Windows Companion (example OS): LIBNAME Statement&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/chloptfmain.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/chloptfmain.htm&lt;/A&gt;&lt;/LIBREF&gt;</description>
      <pubDate>Fri, 09 Oct 2009 12:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75239#M21811</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-09T12:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75240#M21812</link>
      <description>Thanks Scott,&lt;BR /&gt;
I think that I found a solution. I adapted the syntax from &lt;BR /&gt;
&lt;A href="http://www.studysas.blogspot.com/2009/04/how-to-determine-executing-program-name.html" target="_blank"&gt;http://www.studysas.blogspot.com/2009/04/how-to-determine-executing-program-name.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
As follows:&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select scan(xpath,-1,'\') into :progname from sashelp.vextfl&lt;BR /&gt;
where upcase(xpath) like '%.SAS';&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
%put &amp;amp;progname;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select xpath into :progpath&lt;BR /&gt;
from sashelp.vextfl where upcase(xpath) like '%.SAS';&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
%put %substr(&amp;amp;progpath,1,%length(&amp;amp;progpath)-%length(&amp;amp;progname)-1);&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
JuanVte.</description>
      <pubDate>Fri, 09 Oct 2009 13:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75240#M21812</guid>
      <dc:creator>JuanVte</dc:creator>
      <dc:date>2009-10-09T13:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75241#M21813</link>
      <description>For the ".\data" syntax to be supported, it has to be supported at the OS level.&lt;BR /&gt;
&lt;BR /&gt;
Although&lt;BR /&gt;
   libname data '.\data';&lt;BR /&gt;
may not work in Windows,&lt;BR /&gt;
   LIBNAME data './data';&lt;BR /&gt;
does work in Unix.</description>
      <pubDate>Fri, 09 Oct 2009 18:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75241#M21813</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-10-09T18:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75242#M21814</link>
      <description>It works in Winders too&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
1    libname here '.\data';&lt;BR /&gt;
NOTE: Libref HERE was successfully assigned as follows:&lt;BR /&gt;
      Engine:        V9&lt;BR /&gt;
      Physical Name: C:\Documents and Settings\datanull\My Documents\My SAS Files\9.1\data&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Depending on how the program is started it may not point to where you think.  For me when I run my program in BATCH '.' is usually the same directory where the source program is stored.</description>
      <pubDate>Fri, 09 Oct 2009 19:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75242#M21814</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-10-09T19:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Work in the current directory</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75243#M21815</link>
      <description>Yes, it works but as you commented you have to define first the working directory. &lt;BR /&gt;
&lt;BR /&gt;
In html this directory is just the directory where you execute the syntax. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
thank for all your comments!!&lt;BR /&gt;
Juanvte</description>
      <pubDate>Mon, 12 Oct 2009 18:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Work-in-the-current-directory/m-p/75243#M21815</guid>
      <dc:creator>JuanVte</dc:creator>
      <dc:date>2009-10-12T18:02:12Z</dc:date>
    </item>
  </channel>
</rss>

