<?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: Converting Months into Years in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510978#M2066</link>
    <description>&lt;P&gt;Thanks for your reply. I was able to create years, but in the process, the value of capital and interest also got fixed with the years. Maybe I have placed the code at a wrong place. Please, can you let me know the correct location?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is what my initial code was:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data file;&lt;BR /&gt;format Year Month&amp;nbsp;Capital Interest;&lt;BR /&gt;Principal = 4000;&lt;BR /&gt;Deposits = 90;&lt;BR /&gt;do until (Principal &amp;gt;= 100000);&lt;BR /&gt;Interest = (Principal + Deposits) * 0.01;&lt;BR /&gt;Capital = Interest + Capital;&lt;BR /&gt;Month + 1;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Nov 2018 09:23:41 GMT</pubDate>
    <dc:creator>Ibad</dc:creator>
    <dc:date>2018-11-07T09:23:41Z</dc:date>
    <item>
      <title>Converting Months into Years</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510965#M2061</link>
      <description>&lt;P&gt;Hi, I have just started using SAS. I have a question, where I need to get answers in Years. I have got it in months by&amp;nbsp;Month + 1; command. How can I get a column of years parallel to months, where I can have the year number for each corresponding month. E.g. month 25 falls into year 3.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 07:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510965#M2061</guid>
      <dc:creator>Ibad</dc:creator>
      <dc:date>2018-11-07T07:38:02Z</dc:date>
    </item>
    <item>
      <title>Code for Cycles (Values that are fixed during a year)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510967#M2063</link>
      <description>&lt;P&gt;Please help me in writing a DO loop code for variables that are fixed during a year, and change after the year-end. For example, variable changes from A to B and then to C at the end of 12 month period.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 07:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510967#M2063</guid>
      <dc:creator>Ibad</dc:creator>
      <dc:date>2018-11-07T07:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Months into Years</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510968#M2062</link>
      <description>&lt;P&gt;Use the mod() function to detect the start of a new year:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;year = 0;
do month = 1 to 36;
  if mod(month,12) = 1 then year + 1;
  /* further processing */
end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All of this in a data step, of course.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 07:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510968#M2062</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-07T07:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Code for Cycles (Values that are fixed during a year)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510969#M2064</link>
      <description>&lt;P&gt;I merged the threads because the question is basically the same.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 07:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510969#M2064</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-07T07:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Months into Years</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510973#M2065</link>
      <description>Thank you sir, the years are formed but I think i have written the code at some incorrect location, and the values of capital and interest are changed.&lt;BR /&gt;&lt;BR /&gt;Can you help me where to place the above command?</description>
      <pubDate>Wed, 07 Nov 2018 08:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510973#M2065</guid>
      <dc:creator>Ibad</dc:creator>
      <dc:date>2018-11-07T08:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Months into Years</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510978#M2066</link>
      <description>&lt;P&gt;Thanks for your reply. I was able to create years, but in the process, the value of capital and interest also got fixed with the years. Maybe I have placed the code at a wrong place. Please, can you let me know the correct location?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is what my initial code was:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data file;&lt;BR /&gt;format Year Month&amp;nbsp;Capital Interest;&lt;BR /&gt;Principal = 4000;&lt;BR /&gt;Deposits = 90;&lt;BR /&gt;do until (Principal &amp;gt;= 100000);&lt;BR /&gt;Interest = (Principal + Deposits) * 0.01;&lt;BR /&gt;Capital = Interest + Capital;&lt;BR /&gt;Month + 1;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 09:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510978#M2066</guid>
      <dc:creator>Ibad</dc:creator>
      <dc:date>2018-11-07T09:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Months into Years</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510983#M2068</link>
      <description>&lt;P&gt;You have created an infinite loop since the value of principal never changes.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 09:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-Months-into-Years/m-p/510983#M2068</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-07T09:30:43Z</dc:date>
    </item>
  </channel>
</rss>

