<?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 How to create a variable that is when the row value is equal to the column title in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-that-is-when-the-row-value-is-equal-to/m-p/365884#M86956</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;acc_num &amp;nbsp; year &amp;nbsp; &amp;nbsp; int_2001 &amp;nbsp;int_2002 &amp;nbsp;&lt;SPAN&gt;int_2003 .... &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2001 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.05 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.03 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.03 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically, I want to create a new variable interest that is equal to the interest of that year, so for example, for acc_num "C", I want to have the interest equal to 0.04 because I want to get the interest when year 2003 is the same as the last 4 numbers &amp;nbsp;of the column title "int_2003"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When can I write the program to do that? Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2017 03:58:07 GMT</pubDate>
    <dc:creator>yukine</dc:creator>
    <dc:date>2017-06-10T03:58:07Z</dc:date>
    <item>
      <title>How to create a variable that is when the row value is equal to the column title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-that-is-when-the-row-value-is-equal-to/m-p/365884#M86956</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;acc_num &amp;nbsp; year &amp;nbsp; &amp;nbsp; int_2001 &amp;nbsp;int_2002 &amp;nbsp;&lt;SPAN&gt;int_2003 .... &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2001 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.05 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.03 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.03 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically, I want to create a new variable interest that is equal to the interest of that year, so for example, for acc_num "C", I want to have the interest equal to 0.04 because I want to get the interest when year 2003 is the same as the last 4 numbers &amp;nbsp;of the column title "int_2003"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When can I write the program to do that? Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2017 03:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-that-is-when-the-row-value-is-equal-to/m-p/365884#M86956</guid>
      <dc:creator>yukine</dc:creator>
      <dc:date>2017-06-10T03:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable that is when the row value is equal to the column title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-that-is-when-the-row-value-is-equal-to/m-p/365885#M86957</link>
      <description>&lt;P&gt;Create an array and assign an index that maps to the year&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array int_rate(2001:2003) int_2001 - int_2003;

interest_year = int_rate(year);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2017 04:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-that-is-when-the-row-value-is-equal-to/m-p/365885#M86957</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-10T04:05:25Z</dc:date>
    </item>
  </channel>
</rss>

