<?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 statement not finding folder with macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392173#M94330</link>
    <description>Symbolgen caught the issue, when I formatted the piped in data I was just dropping a single digit from the CheckFolder variable. Thank you all for the help!</description>
    <pubDate>Thu, 31 Aug 2017 12:45:28 GMT</pubDate>
    <dc:creator>Dougall</dc:creator>
    <dc:date>2017-08-31T12:45:28Z</dc:date>
    <item>
      <title>Libname statement not finding folder with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392007#M94245</link>
      <description>I am trying to dynamically create a SAS library. A new folder is created every day, title is date and time I.e yyyymmddhhmmss.&lt;BR /&gt;An example title would be 20160114134615 (no letters in the folder name)&lt;BR /&gt;I pipe in the directory structure, get the folder name I need, and allocate to a macro variable called CheckFolder using an sql select into: statement.&lt;BR /&gt;I then try&lt;BR /&gt;Libname Sample "&amp;amp;samplePath\&amp;amp;CheckFolder";&lt;BR /&gt;I receive NOTE: Library SAMPLE does not exist.&lt;BR /&gt;If I were to use :&lt;BR /&gt;Libname Sample "&amp;amp;samplePath\20160114134615";&lt;BR /&gt;It creates the library no problem.&lt;BR /&gt;&lt;BR /&gt;I have checked the &amp;amp;samplepath variable, there are no issues there.&lt;BR /&gt;&lt;BR /&gt;Is there some general reason this statement fails?&lt;BR /&gt;&lt;BR /&gt;PS: sorry for not posting code, no internet access on my computer so I had to post this from my phone.</description>
      <pubDate>Wed, 30 Aug 2017 20:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392007#M94245</guid>
      <dc:creator>Dougall</dc:creator>
      <dc:date>2017-08-30T20:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Libname statement not finding folder with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392017#M94248</link>
      <description>&lt;P&gt;Run the libname statement with the MPRINT and SYMBOLGEN options turned on. It will show what the log is trying to submit and where the error is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's possible you need a period (.) after the macro variable to force it to resolve properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Libname Sample "&amp;amp;samplePath.\&amp;amp;CheckFolder.";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 20:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392017#M94248</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-30T20:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Libname statement not finding folder with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392031#M94251</link>
      <description>&lt;P&gt;Your tests clearly narrow the problem down to the value of &amp;amp;CheckFolder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the red flags is that &amp;amp;CheckFolder gets created by SQL into.&amp;nbsp; It's possible that SQL performs a numeric to character conversion when assigning the value.&amp;nbsp; That might introduce leading blanks, or possibly conversion to scientific notation.&amp;nbsp; Check what you are getting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put **&amp;amp;CheckFolder**;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 20:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392031#M94251</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-08-30T20:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Libname statement not finding folder with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392051#M94256</link>
      <description>&lt;P&gt;SAS character variables are fixed length fields, so make sure to use the TRIMMED option on the INTO clause.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select charvar_or_function
  into :CheckFolder trimmed
  from ....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or add a step to remove the trailing spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CheckFolder=&amp;amp;CheckFolder;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 22:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392051#M94256</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-30T22:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Libname statement not finding folder with macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392173#M94330</link>
      <description>Symbolgen caught the issue, when I formatted the piped in data I was just dropping a single digit from the CheckFolder variable. Thank you all for the help!</description>
      <pubDate>Thu, 31 Aug 2017 12:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-statement-not-finding-folder-with-macro-variable/m-p/392173#M94330</guid>
      <dc:creator>Dougall</dc:creator>
      <dc:date>2017-08-31T12:45:28Z</dc:date>
    </item>
  </channel>
</rss>

