<?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: Quarters and Periods in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291755#M59917</link>
    <description>&lt;P&gt;How are you providing your start/end date. That looks like output, what does your input look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you should be doing is sketched out below - untested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Finding the number of periods you need to create by using your start/end date with the INTCK function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num_quarters = intck('QTR', start_date, end_date);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Loop over the number of quarters and increment date&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do i= 1 to num_quarters;
     date = intnx('Quarter', start_date, i, 'b');
     OUTPUT;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Aug 2016 19:24:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-08-15T19:24:09Z</dc:date>
    <item>
      <title>Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291752#M59915</link>
      <description>&lt;P&gt;&lt;SPAN&gt;For this dataset only variable A is populated ,I want to create 2 variables date and periods as shown in the excel.The code should be such that once i specify the start date and end date,it should generate all the quarters and their corresponding period starting from zero.In this dataset variable A has 42 values,so if i specify start date as 31-dec-2015 and end date as 31-dec-2020,it should generate all the inbetween quarters as shown in image and also their corresponding quartes.it should also repeat iti.e if Variable A has 42 values it should repeat it twice(42/21)&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12850i968E26BF12FB8832/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="sas q1.jpg" title="sas q1.jpg" /&gt;</description>
      <pubDate>Mon, 15 Aug 2016 19:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291752#M59915</guid>
      <dc:creator>Swapnasis</dc:creator>
      <dc:date>2016-08-15T19:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291754#M59916</link>
      <description>&lt;P&gt;Do you have the possiblity where a value for the A variable might duplicate a previous value but not be the start of a duplicate set?&lt;/P&gt;
&lt;P&gt;What is the largest number of values that might be involved with a sequence in A?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 19:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291754#M59916</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-15T19:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291755#M59917</link>
      <description>&lt;P&gt;How are you providing your start/end date. That looks like output, what does your input look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you should be doing is sketched out below - untested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Finding the number of periods you need to create by using your start/end date with the INTCK function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num_quarters = intck('QTR', start_date, end_date);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Loop over the number of quarters and increment date&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do i= 1 to num_quarters;
     date = intnx('Quarter', start_date, i, 'b');
     OUTPUT;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2016 19:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291755#M59917</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-15T19:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291959#M59920</link>
      <description>the Variable A can carry any value(not specific to what I have shown in&lt;BR /&gt;the image).but the total no.of rows will be in mutiples of 21.&lt;BR /&gt;What I exactly want is if the variable A is given in the input&lt;BR /&gt;dataset.create the two varibles dates and period as given in the image file&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Tue, 16 Aug 2016 17:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291959#M59920</guid>
      <dc:creator>Swapnasis</dc:creator>
      <dc:date>2016-08-16T17:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291962#M59921</link>
      <description>&lt;P&gt;Well, without sample input data (I'm not going to type out your data from a picture) I think the code provided initially is a good start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've tried it, please post what you've tried and what doesn't work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 18:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291962#M59921</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-16T18:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291963#M59922</link>
      <description>&lt;P&gt;To me only the dataset with variable A is populated.I have been told that start date is 31-Dec-2015 and end date is 31-dec2020.&lt;/P&gt;&lt;P&gt;I have to create a dates coloumn such that all the 21 quarters are populated in a manner as shown in the image file.along with that i have to create a period coloumn as &amp;nbsp;shown in the image&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 18:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291963#M59922</guid>
      <dc:creator>Swapnasis</dc:creator>
      <dc:date>2016-08-16T18:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Quarters and Periods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291967#M59923</link>
      <description>&lt;P&gt;Below is the attachment of the input data.U have write a code to produce a dataset which looks llike my previous image&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 18:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quarters-and-Periods/m-p/291967#M59923</guid>
      <dc:creator>Swapnasis</dc:creator>
      <dc:date>2016-08-16T18:09:17Z</dc:date>
    </item>
  </channel>
</rss>

