<?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 Can we replace macro variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217856#M267767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/*************** macro varaiable *********************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;% let &lt;SPAN style="font-size: 13.3333330154419px;"&gt;refvar = AEENDT ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/********************* creating new variable =&lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDY&amp;nbsp; *******************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data works._RefDate_;&lt;/P&gt;&lt;P&gt;set&amp;nbsp; _RefDate_;&lt;/P&gt;&lt;P&gt;RFSTDTC =input ( RFSTDTC&amp;nbsp; ,YYMMDD10.);&lt;/P&gt;&lt;P&gt;if&amp;nbsp; &amp;amp;refvar.&amp;nbsp;&amp;nbsp; le RFSTDTC then&amp;nbsp; AEENDY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar. - RFSTDTC + 1;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; &amp;amp;refvar.&amp;nbsp; ge RFSTDTC then&amp;nbsp; AEENDY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar. - RFSTDTC ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro varaible&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDT&amp;nbsp; has &lt;SPAN style="color: #222222; font-family: arial, sans-serif-light, sans-serif; font-size: xx-large; background-color: #ffffff;"&gt;suffix "DT" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;DT should&amp;nbsp; be place by "DY"...&amp;nbsp; and&amp;nbsp; create the new &lt;/SPAN&gt;variable.. "&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&amp;nbsp; In the above code i have hard code the new variable name "&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDY ".""&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 07:39:48 GMT</pubDate>
    <dc:creator>anitapamu2</dc:creator>
    <dc:date>2015-05-21T07:39:48Z</dc:date>
    <item>
      <title>Can we replace macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217856#M267767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/*************** macro varaiable *********************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;% let &lt;SPAN style="font-size: 13.3333330154419px;"&gt;refvar = AEENDT ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/********************* creating new variable =&lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDY&amp;nbsp; *******************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data works._RefDate_;&lt;/P&gt;&lt;P&gt;set&amp;nbsp; _RefDate_;&lt;/P&gt;&lt;P&gt;RFSTDTC =input ( RFSTDTC&amp;nbsp; ,YYMMDD10.);&lt;/P&gt;&lt;P&gt;if&amp;nbsp; &amp;amp;refvar.&amp;nbsp;&amp;nbsp; le RFSTDTC then&amp;nbsp; AEENDY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar. - RFSTDTC + 1;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; &amp;amp;refvar.&amp;nbsp; ge RFSTDTC then&amp;nbsp; AEENDY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar. - RFSTDTC ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro varaible&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDT&amp;nbsp; has &lt;SPAN style="color: #222222; font-family: arial, sans-serif-light, sans-serif; font-size: xx-large; background-color: #ffffff;"&gt;suffix "DT" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;DT should&amp;nbsp; be place by "DY"...&amp;nbsp; and&amp;nbsp; create the new &lt;/SPAN&gt;variable.. "&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&amp;nbsp; In the above code i have hard code the new variable name "&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;AEENDY ".""&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 07:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217856#M267767</guid>
      <dc:creator>anitapamu2</dc:creator>
      <dc:date>2015-05-21T07:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can we replace macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217857#M267768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what kind of dynamics you want, but can't you just use &amp;amp;refvar instead of the hard code variable name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 07:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217857#M267768</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-05-21T07:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can we replace macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217858#M267769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to put the variable name in a macro variable at all, I don't see any benefit?&amp;nbsp; All your doing is complicating the code.&amp;nbsp;&amp;nbsp; If you really really have to use macro then put the base part of the variable in the macro and then append the additional part:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;% let &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;refvar = AEEN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/********************* creating new variable =&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;AEENDY&amp;nbsp; *******************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data works._RefDate_;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp; _RefDate_;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RFSTDTC =input ( RFSTDTC&amp;nbsp; ,YYMMDD10.);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; &amp;amp;refvar.DT&amp;nbsp;&amp;nbsp; le RFSTDTC then&amp;nbsp; &amp;amp;refvar.DY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar.DT - RFSTDTC + 1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; &amp;amp;refvar.DT&amp;nbsp; ge RFSTDTC then&amp;nbsp; &amp;amp;refvar.DY&amp;nbsp; =&amp;nbsp; &amp;amp;refvar.DT - RFSTDTC ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Again though, this oesn't add any value, so why bother?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 08:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-replace-macro-variable/m-p/217858#M267769</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-21T08:22:31Z</dc:date>
    </item>
  </channel>
</rss>

