<?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: Libname with Macro specifying Directory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Libname-with-Macro-specifying-Directory/m-p/228002#M41130</link>
    <description>&lt;P&gt;You have put your directory in a macro variable. Using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname libsas 'dirSAS';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You are trying to create a libname called libsas of the directory dirSAS(that doesn't exist). To replace the content of a macro variable you must use &amp;amp; before the name of the variable. Furthermore simple quote doesn't allow macro replacement, you must use double quotation marks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname libsas "&amp;amp;dirSAS";&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Oct 2015 06:45:47 GMT</pubDate>
    <dc:creator>arodriguez</dc:creator>
    <dc:date>2015-10-01T06:45:47Z</dc:date>
    <item>
      <title>Libname with Macro specifying Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-with-Macro-specifying-Directory/m-p/227994#M41127</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have two libname statements in the attached code (I only run 1 at a time) that should be the same yet only one works. The direct call-out works but using the macro variable name does not.&amp;nbsp;From what I can tell, these are the EXACT SAME things. When I run the libname using dirSAS &amp;nbsp;I receive an error. Please advise.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dirLSB=/folders/myshortcuts/MyRawData;&lt;BR /&gt;%let dirSAS=/folders/myfolders;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*libname libsas 'dirSAS'; *This does not work;&lt;BR /&gt;libname libsas '/folders/myfolders'; *This does work;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data libsas.Snow1;&lt;BR /&gt;infile "&amp;amp;dirLSB/Pr1Snowfall1.csv"&lt;BR /&gt;DLM =','; *Range of, comma delim;&lt;BR /&gt;input Season $ Sep Oct Nov Dec Jan Feb Mar Apr May Total;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NOTE: Library LIBSAS does not exist.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 04:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-with-Macro-specifying-Directory/m-p/227994#M41127</guid>
      <dc:creator>axn9077</dc:creator>
      <dc:date>2015-10-01T04:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Libname with Macro specifying Directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-with-Macro-specifying-Directory/m-p/228002#M41130</link>
      <description>&lt;P&gt;You have put your directory in a macro variable. Using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname libsas 'dirSAS';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You are trying to create a libname called libsas of the directory dirSAS(that doesn't exist). To replace the content of a macro variable you must use &amp;amp; before the name of the variable. Furthermore simple quote doesn't allow macro replacement, you must use double quotation marks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname libsas "&amp;amp;dirSAS";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2015 06:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-with-Macro-specifying-Directory/m-p/228002#M41130</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2015-10-01T06:45:47Z</dc:date>
    </item>
  </channel>
</rss>

