<?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: Can we macronize the libnames? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112877#M31258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi esjackso1,&lt;/P&gt;&lt;P&gt;Thank you very much, your suggestion worked well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you pls let me know why we need to include a double period?&lt;/P&gt;&lt;P&gt;I can only understand the places where we need to include a single period though.&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Apr 2013 15:31:23 GMT</pubDate>
    <dc:creator>Mirisage</dc:creator>
    <dc:date>2013-04-19T15:31:23Z</dc:date>
    <item>
      <title>Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112875#M31256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran the following two macros for two products, i.e. mango and orange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MACRO I:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro anyname(mth=, month=, product=);&lt;BR /&gt;title "Distribution of values of Income variable in &amp;amp;product file in &amp;amp;month";&lt;/P&gt;&lt;P&gt;proc freq data=&lt;SPAN style="color: #ff00ff;"&gt;mango&lt;/SPAN&gt;.&amp;amp;product._&amp;amp;mth; &lt;STRONG style="color: #ff0000;"&gt;/*Why can't I change libname &lt;SPAN style="color: #ff00ff;"&gt;mango&lt;/SPAN&gt; to &amp;amp;&lt;SPAN style="color: #ff00ff;"&gt;product&lt;/SPAN&gt;*/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #ff0000;"&gt;&amp;nbsp; &lt;/STRONG&gt; tables county;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt; %mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%anyname(mth=Dec12, month=Dec2012, product=mango);&lt;BR /&gt;%anyname(mth=Jan13, month=Jan2013, product=mango);&lt;BR /&gt;%anyname(mth=Feb13, month=Feb2013, product=mango);&lt;BR /&gt;%anyname(mth=Mar13, month=Mar2013, product=mango);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MACRO 2:&lt;/P&gt;&lt;P&gt;%macro anyname(mth=, month=, product=);&lt;BR /&gt;title "Distribution of values of Income variable in &amp;amp;product file in &amp;amp;month";&lt;/P&gt;&lt;P&gt;proc freq data=&lt;SPAN style="color: #ff00ff;"&gt;orange&lt;/SPAN&gt;.&amp;amp;product._&amp;amp;mth; &lt;STRONG style="color: #ff0000;"&gt;/*Why can't I change &lt;SPAN style="color: #ff00ff;"&gt;orange &lt;/SPAN&gt; to &amp;amp;&lt;SPAN style="color: #ff00ff;"&gt;orange&lt;/SPAN&gt;*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt; &lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; tables village ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt; %mend;&lt;/P&gt;&lt;P&gt;%anyname(mth=Dec12, month=Dec2012, product=orange);&lt;BR /&gt;%anyname(mth=Jan13, month=Jan2013, product=orange);&lt;BR /&gt;%anyname(mth=Feb13, month=Feb2013, product=orange);&lt;BR /&gt;%anyname(mth=Mar13, month=Mar2013, product=orange);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Background for Question;&lt;/SPAN&gt;&lt;BR /&gt;As Mango and Orange data are found in two different libraries, namely "Mango" and "Orange", &lt;BR /&gt;it necessitated two macros, MACRO I and 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to macronize libnames too to avoid MACRO 2, but it doesn't seem working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Question:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can't we macronize libnames (as shown in red and pink colors above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 19:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112875#M31256</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-04-18T19:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112876#M31257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you have a double period after the libname macro var?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data= &amp;amp;libname..&amp;amp;product.__&amp;amp;mth ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 19:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112876#M31257</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-04-18T19:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112877#M31258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi esjackso1,&lt;/P&gt;&lt;P&gt;Thank you very much, your suggestion worked well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you pls let me know why we need to include a double period?&lt;/P&gt;&lt;P&gt;I can only understand the places where we need to include a single period though.&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 15:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112877#M31258</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-04-19T15:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112878#M31259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need it in two places that come to mind: file names and libname refereces both because they have period within the syntax, if memory serves e because the period and acts as a delimiter like a space when the macro is complied:&lt;/P&gt;&lt;P&gt;&amp;amp;test..xls --&amp;gt; where &amp;amp;test. is the macro variable and .xls is the file extension syntax --&amp;gt; without the extra period the file name fails because improper filename (ie no extension).&lt;/P&gt;&lt;P&gt;&amp;amp;libname..data --&amp;gt; where &amp;amp;libname. is the macro variable and .data is the dataset name syntax --&amp;gt; without it probably reads as the name of a temporary dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 15:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112878#M31259</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-04-19T15:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112879#M31260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS macro language needs to know how to figure out what macro variable you are trying to reference.&amp;nbsp; In most situation you can rely on the presence of spaces and other characters that are invalid to use as part of a variable name.&amp;nbsp; But to handle the situations where you want to reference a macro variable and append characters and digits the language allows you to follow the macro variable name with a period.&amp;nbsp; For example if I had a macro variable, VARNAME, with the base name of a variable and I wanted to use it to generate code to reference a new variable with _POST appended to it.&amp;nbsp; If I reference &amp;amp;VARNAME_POST the macro processor (and a human reading the code) would look for a macro variable name VARNAME_POST.&amp;nbsp; If you add the period then it is clear that macro variable name is VARNAME and that _POST is just constant text.&amp;nbsp; &amp;amp;VARNAME._POST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your situation where you want generate a string (dataset reference) that includes a period you need to add an extra period.&amp;nbsp; The first one will be used by the macro processor to signal the end of the macro variable reference and the second one will become the constant text to use as part of the dataset reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 17:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112879#M31260</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-19T17:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can we macronize the libnames?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112880#M31261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi esjackso1 and Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks to both of you for this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Apr 2013 14:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-macronize-the-libnames/m-p/112880#M31261</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2013-04-20T14:16:18Z</dc:date>
    </item>
  </channel>
</rss>

