<?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: re-base a series in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/377002#M90507</link>
    <description>&lt;P&gt;Thanks very much!&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2017 13:47:49 GMT</pubDate>
    <dc:creator>flyingbear</dc:creator>
    <dc:date>2017-07-18T13:47:49Z</dc:date>
    <item>
      <title>re-base a series</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376769#M90476</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Time series data (CPI, for example) are often indexed to a specific base&amp;nbsp;year such that the value in that year is 1 (or 100) and the values in other years are expressed as ratios to the base year value.&amp;nbsp; I would like to re-base (or re-index) my series to a new base year which simply involves dividing each value by the value in my desired base year.&amp;nbsp; The difficulty is that for the early years, I need to know the value in&amp;nbsp;that later, base&amp;nbsp;year.&amp;nbsp; Does anyone know if there's a simple way to do this (i.e. without getting in to macro programming)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 21:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376769#M90476</guid>
      <dc:creator>flyingbear</dc:creator>
      <dc:date>2017-07-17T21:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: re-base a series</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376804#M90487</link>
      <description>&lt;P&gt;You simply select the base year value into a macro variable first and use it in your data step like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input year val;
	datalines;
2000 50
2001 60
2002 70
2003 75
2004 90
2005 100
2006 120
2007 150
2008 155
2009 200
;
run;

/* Store the base year value in a macro variable */

proc sql;
	select val into :base_val
	from have
	where year =2004;
quit;

data want;
	set have;
	index_val=val/&amp;amp;base_val;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2017 23:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376804#M90487</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-07-17T23:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: re-base a series</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376891#M90497</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An other possible solution :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	retain base;

	if _N_=1 then do;
		set have (where=(year=2004));
		base=val;
	end;

	set have;
	index_val=val/base;

	drop base;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 08:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/376891#M90497</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-07-18T08:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: re-base a series</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/377002#M90507</link>
      <description>&lt;P&gt;Thanks very much!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 13:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/377002#M90507</guid>
      <dc:creator>flyingbear</dc:creator>
      <dc:date>2017-07-18T13:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: re-base a series</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/377003#M90508</link>
      <description>Thanks! This is very instructive regarding the data step -- helpful for this problem and in the future.</description>
      <pubDate>Tue, 18 Jul 2017 13:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-base-a-series/m-p/377003#M90508</guid>
      <dc:creator>flyingbear</dc:creator>
      <dc:date>2017-07-18T13:50:58Z</dc:date>
    </item>
  </channel>
</rss>

