<?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: Macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240792#M44492</link>
    <description>&lt;P&gt;What do you want the ouput to look like?&amp;nbsp; If you set test to be "1" - remember all macro variables are text, then the put statement resolves to:&lt;/P&gt;
&lt;P&gt;%put This macro variable has a period 1.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Dec 2015 12:53:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-12-24T12:53:37Z</dc:date>
    <item>
      <title>Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240629#M44423</link>
      <description>&lt;P&gt;May I request someone to tell me when we should put a period(.) while calling a macro variable? In some cases, macro variable will get resolved if we just put ampersand (e.g. &amp;amp;test) and in other cases we need to put a period (e.g.&amp;amp;test&lt;STRONG&gt;.&lt;/STRONG&gt;&amp;nbsp;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any advise you offer me!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 10:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240629#M44423</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-23T10:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240630#M44424</link>
      <description>&lt;P&gt;Well, the SAS language will allow you to not put the period after a macro variable where it can clearly still identifiy the end of macro variable, e.g. a space. &amp;nbsp;Whilst this is possible I would strongly advise against doing it this way. &amp;nbsp;In my opionion nowadays, code readbility is far more important that saving a character space. &amp;nbsp;Code layout - e.g. indetations, well formed code - i.e. finisihng macro variable with period, finishing steps with run; or quit;, consistent casing - i.e. all code in lower case unless needed etc. will make your code far more readable. &amp;nbsp;If you ever have to pick up someone else's code you will know what I mean. &amp;nbsp;Long gone are the days where text space is limited and saving a tiny fraction of a second is more important than being able to maintain programs and keep transparancy on the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So TL;DR, in my opinion always use a period. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 11:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240630#M44424</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-23T11:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240642#M44425</link>
      <description>&lt;P&gt;Thanks for your advise!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would be the best example where I should use period and should not use period while resolving macro variable?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 11:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240642#M44425</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-23T11:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240645#M44426</link>
      <description>&lt;P&gt;Thats really my point, there should never be an instance where you wouldn't put the period in. &amp;nbsp;Its not special functionality or anything, just laziness and sloppy coding. &amp;nbsp;Always put the period in.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 11:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240645#M44426</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-23T11:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240670#M44439</link>
      <description>&lt;P&gt;Some examples of when it are needed, when the text needs a period. Since the period is attached to the macro variable you need two periods:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let test=Macro Variable;
%put This macro variable has a period &amp;amp;test..;

%put How do I know whats text and whats my &amp;amp;test if it forms part of a file path?;
%put Path = "C:/temp/&amp;amp;testSaved.txt";
%put Path = "C:/temp/&amp;amp;test.Saved.txt";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;The documentation also explains this fairly well.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001071889.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001071889.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 15:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240670#M44439</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-23T15:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240750#M44468</link>
      <description>"May I request someone to tell me when we should put a period(.) while calling a macro variable?"&lt;BR /&gt;Always. Put period after macro variable is always right.</description>
      <pubDate>Thu, 24 Dec 2015 01:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240750#M44468</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-24T01:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240778#M44484</link>
      <description>&lt;P&gt;Thanks for your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I don't have SAS enviornment to execute your code, may I know why you have placed two periods in following put statement? Won't it get resolved if you place one period?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put This macro variable has a period &amp;amp;test..;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Dec 2015 09:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240778#M44484</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-24T09:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240779#M44485</link>
      <description>&lt;P&gt;%put This macro variable has a period &amp;amp;test..;&lt;/P&gt;
&lt;P&gt;The first period after test shows that the macro variable finishes, the second period is just plain text. &amp;nbsp;So assume test has the value "too", then it resolves to:&lt;BR /&gt;%put This macro variable has a period too.;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 09:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240779#M44485</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-24T09:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240787#M44489</link>
      <description>You can download SASUE to learn on.</description>
      <pubDate>Thu, 24 Dec 2015 11:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240787#M44489</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-24T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240788#M44490</link>
      <description>&lt;P&gt;Thanks for your explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What if the macro variable test has a value (numeric) "1". Do we still want to put two periods like below while resolving?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put This macro variable has a period &amp;amp;test..;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Dec 2015 12:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240788#M44490</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-24T12:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240792#M44492</link>
      <description>&lt;P&gt;What do you want the ouput to look like?&amp;nbsp; If you set test to be "1" - remember all macro variables are text, then the put statement resolves to:&lt;/P&gt;
&lt;P&gt;%put This macro variable has a period 1.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 12:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable/m-p/240792#M44492</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-24T12:53:37Z</dc:date>
    </item>
  </channel>
</rss>

