<?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 for a changing value in a calculation in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-for-a-changing-value-in-a-calculation/m-p/244297#M6415</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to use a different value (number) for my formula everytime. Is there a way I can write a simple macro eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;newvar=(oldvar- 9) x var2&lt;/P&gt;&lt;P&gt;the number 9 will change to 3, 6, and different values?&lt;/P&gt;&lt;P&gt;Help&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2016 21:04:36 GMT</pubDate>
    <dc:creator>AZIQ1</dc:creator>
    <dc:date>2016-01-18T21:04:36Z</dc:date>
    <item>
      <title>Macro for a changing value in a calculation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-for-a-changing-value-in-a-calculation/m-p/244297#M6415</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to use a different value (number) for my formula everytime. Is there a way I can write a simple macro eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;newvar=(oldvar- 9) x var2&lt;/P&gt;&lt;P&gt;the number 9 will change to 3, 6, and different values?&lt;/P&gt;&lt;P&gt;Help&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 21:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-for-a-changing-value-in-a-calculation/m-p/244297#M6415</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2016-01-18T21:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for a changing value in a calculation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-for-a-changing-value-in-a-calculation/m-p/244298#M6416</link>
      <description>&lt;P&gt;Yes, is there any pattern to the changes though?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you plan to execute each of your values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you creating new_var that needs to be unique for each value? If so, how is each identified?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you creating a new data set that needs to be unique for each value? If so, how is each data set identified?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The gist is create a macro variable..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let constant=9;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar=(oldvar-&amp;amp;constant) * var2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change constant, run the data step and&amp;nbsp;newvar&amp;nbsp;will change.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 21:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-for-a-changing-value-in-a-calculation/m-p/244298#M6416</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-18T21:14:19Z</dc:date>
    </item>
  </channel>
</rss>

