<?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 macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328532#M73356</link>
    <description>&lt;P&gt;I run the data and got the results as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Original &lt;EM&gt;2015&lt;/EM&gt; Average Allowed Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Projected &lt;EM&gt;2017&lt;/EM&gt; Allowed Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Projected Percent Change&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;$22,768.81&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;$22,762.06&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-0.03%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;We have new&amp;nbsp;data next year and I want to run the new data, but the&amp;nbsp;years have to be updated into "&lt;STRONG&gt;2016&lt;/STRONG&gt;" and "&lt;STRONG&gt;2018&lt;/STRONG&gt;" respectively. The "&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original &lt;EM&gt;2015&lt;/EM&gt; Average Allowed Amount&lt;/STRONG&gt;" and "&lt;STRONG&gt;Projected &lt;EM&gt;2017&lt;/EM&gt; Allowed Amount&lt;/STRONG&gt;" are variable names in my data. I don't want to manually change the variable names each year. I&amp;nbsp;tried to define&amp;nbsp;macro variable names to update the years automatically, but I failed. Any ideas, suggestions and recommendations will be greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 17:52:08 GMT</pubDate>
    <dc:creator>zhuxiaoyan1</dc:creator>
    <dc:date>2017-01-30T17:52:08Z</dc:date>
    <item>
      <title>macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328532#M73356</link>
      <description>&lt;P&gt;I run the data and got the results as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Original &lt;EM&gt;2015&lt;/EM&gt; Average Allowed Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Projected &lt;EM&gt;2017&lt;/EM&gt; Allowed Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Projected Percent Change&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;$22,768.81&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;$22,762.06&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-0.03%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;We have new&amp;nbsp;data next year and I want to run the new data, but the&amp;nbsp;years have to be updated into "&lt;STRONG&gt;2016&lt;/STRONG&gt;" and "&lt;STRONG&gt;2018&lt;/STRONG&gt;" respectively. The "&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original &lt;EM&gt;2015&lt;/EM&gt; Average Allowed Amount&lt;/STRONG&gt;" and "&lt;STRONG&gt;Projected &lt;EM&gt;2017&lt;/EM&gt; Allowed Amount&lt;/STRONG&gt;" are variable names in my data. I don't want to manually change the variable names each year. I&amp;nbsp;tried to define&amp;nbsp;macro variable names to update the years automatically, but I failed. Any ideas, suggestions and recommendations will be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 17:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328532#M73356</guid>
      <dc:creator>zhuxiaoyan1</dc:creator>
      <dc:date>2017-01-30T17:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328537#M73357</link>
      <description>&lt;P&gt;Hi, you have a few options depending on what you want. You could say:&lt;/P&gt;
&lt;P&gt;%let year=2018;&lt;/P&gt;
&lt;P&gt;%let prev=%eval(&amp;amp;year-2);&lt;/P&gt;
&lt;P&gt;title "&lt;STRONG&gt;Original &lt;EM&gt;&amp;amp;prev&lt;/EM&gt;&amp;nbsp;Average Allowed Amount&lt;/STRONG&gt;&lt;SPAN&gt;" and "&lt;/SPAN&gt;&lt;STRONG&gt;Projected &lt;EM&gt;&amp;amp;year&lt;/EM&gt;&amp;nbsp;Allowed Amount&lt;/STRONG&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then just change the first statement as needed. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or if you know it is one year in the future and one year in the past.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%let next=%eval(%substr(&amp;amp;sysdate9, 6, 4)+1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%let prev=%eval(&amp;amp;next-2);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;title "&lt;STRONG&gt;Original &lt;EM&gt;&amp;amp;prev&lt;/EM&gt;&amp;nbsp;Average Allowed Amount&lt;/STRONG&gt;" and "&lt;STRONG&gt;Projected &lt;EM&gt;&amp;amp;next&lt;/EM&gt;&amp;nbsp;Allowed Amount&lt;/STRONG&gt;";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328537#M73357</guid>
      <dc:creator>mbuchecker</dc:creator>
      <dc:date>2017-01-30T18:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328538#M73358</link>
      <description>&lt;P&gt;It would help if you showed the code you tried and indicated what you're actual variable names are. Do they "really" have spaces in them, or are those just the variable labels?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328538#M73358</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-30T18:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328539#M73359</link>
      <description>&lt;P&gt;You may need to show your existing code to make suggestions pointed to specific items of your existing code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since "&lt;STRONG&gt;Original &lt;EM&gt;2015&lt;/EM&gt; Average Allowed Amount&lt;/STRONG&gt;" is definitely not a normal SAS variable name details could be critical to getting working code.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328539#M73359</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-30T18:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328579#M73363</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 21:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328579#M73363</guid>
      <dc:creator>zhuxiaoyan1</dc:creator>
      <dc:date>2017-01-30T21:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328582#M73364</link>
      <description>&lt;P&gt;Yes, you are right. They are&amp;nbsp;labels, not variable names. Sorry about this confusion. I used mbuchecker's code and added label statement and got it fixed. Thank you for your input!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 21:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/328582#M73364</guid>
      <dc:creator>zhuxiaoyan1</dc:creator>
      <dc:date>2017-01-30T21:24:02Z</dc:date>
    </item>
  </channel>
</rss>

