<?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: Assign a library using a numerical macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537043#M147639</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('period',put(&amp;amp;user_mth_end.,yymmn6.));
run;

libname wsale "/sasserver/my_unit/data/Wholesale/&amp;amp;period.";&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Feb 2019 11:49:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-02-20T11:49:06Z</dc:date>
    <item>
      <title>Assign a library using a numerical macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537041#M147638</link>
      <description>&lt;P&gt;I would like to assign a library with a macro variable when the pathname includes a numerical folder name.&lt;/P&gt;&lt;P&gt;I want to create a library with the following path;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname wsale '/sasserver/my_unit/data/Wholesale/201810';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to derive 201810 from the user input which is&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let USER_MTH_END = '31OCT2018'd;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I create 201810 and then pass it to the libname statement? I've tried many things but I can't get it to work without manually typing 201810 in the libname statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 11:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537041#M147638</guid>
      <dc:creator>catmad</dc:creator>
      <dc:date>2019-02-20T11:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a library using a numerical macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537043#M147639</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('period',put(&amp;amp;user_mth_end.,yymmn6.));
run;

libname wsale "/sasserver/my_unit/data/Wholesale/&amp;amp;period.";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2019 11:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537043#M147639</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-20T11:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a library using a numerical macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537044#M147640</link>
      <description>Many thanks Kurt - that was very quick. I think I hadn't tried the correct combination of double quotes and a "." after the variable name.</description>
      <pubDate>Wed, 20 Feb 2019 11:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537044#M147640</guid>
      <dc:creator>catmad</dc:creator>
      <dc:date>2019-02-20T11:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a library using a numerical macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537049#M147641</link>
      <description>&lt;P&gt;Without double quotes macro variables will not get resolved, they just remain as the string '&amp;amp;...'.&amp;nbsp; The dot following the macro variable isn't technically needed in a lot of scenarios, it it there to tell the macro pre-processor that the macro variable name ends at the point, however in some circumtances it is really required, hence good practice is to always put the point at the end of the macro variable name - it will also highlight it as a macro variable in your code.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 12:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-a-library-using-a-numerical-macro-variable/m-p/537049#M147641</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-20T12:13:32Z</dc:date>
    </item>
  </channel>
</rss>

