<?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: How to add quarters in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/461010#M117214</link>
    <description>try:&lt;BR /&gt;future_index=put(intnx('qtr',quarter_index,2),2.);</description>
    <pubDate>Wed, 09 May 2018 13:37:07 GMT</pubDate>
    <dc:creator>Vish33</dc:creator>
    <dc:date>2018-05-09T13:37:07Z</dc:date>
    <item>
      <title>How to add quarters in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/460995#M117207</link>
      <description>&lt;P&gt;Hello all together,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with time quarters and I do need to add or substract quarters from an indexquarter.&lt;/P&gt;&lt;P&gt;Is there any way to do this in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data contains an ID and an index date. With this index date I can define the year and the quarter of that index date.&lt;/P&gt;&lt;P&gt;Using the function yyq I can define the quarter of the index year as sas date value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to add two quarters to the index quarter. (E.g. two quarters of follow-up&amp;nbsp;of a patient)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Programm Looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data two;&lt;/P&gt;&lt;P&gt;set one;&lt;/P&gt;&lt;P&gt;year_index=year(indexdate);&lt;/P&gt;&lt;P&gt;quarter_index_help=qtr(indexdate);&lt;/P&gt;&lt;P&gt;quarter_index=yyq(year_index,quarter_index_help); /* SAS date value with quarter and year */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;future_index=quarter_index+2; /* That's what I want to do, add two quarters */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;&lt;P&gt;sasstats&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 13:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/460995#M117207</guid>
      <dc:creator>sasstats</dc:creator>
      <dc:date>2018-05-09T13:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add quarters in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/461010#M117214</link>
      <description>try:&lt;BR /&gt;future_index=put(intnx('qtr',quarter_index,2),2.);</description>
      <pubDate>Wed, 09 May 2018 13:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/461010#M117214</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2018-05-09T13:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add quarters in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/461023#M117219</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my datastep your syntax worked in the following way:&lt;/P&gt;&lt;P&gt;future_index=intnx('qtr',quarter_index,2);&lt;/P&gt;&lt;P&gt;format future_index yyq.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then it did what I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sasstats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 13:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-quarters-in-SAS/m-p/461023#M117219</guid>
      <dc:creator>sasstats</dc:creator>
      <dc:date>2018-05-09T13:54:40Z</dc:date>
    </item>
  </channel>
</rss>

