<?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 convert/expand quarter to date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323256#M21610</link>
    <description>&lt;P&gt;Thanks Tom for the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As we couldn't figure out a simple way to do that, my collegue &lt;STRONG&gt;used excel&lt;/STRONG&gt; to generate a table&amp;nbsp;that &lt;STRONG&gt;lists&amp;nbsp;all dates and its corresponding quarter&lt;/STRONG&gt;, and then she did a &lt;STRONG&gt;left join&lt;/STRONG&gt; in SAS.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2017 05:43:01 GMT</pubDate>
    <dc:creator>ayin</dc:creator>
    <dc:date>2017-01-09T05:43:01Z</dc:date>
    <item>
      <title>How to convert/expand quarter to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323249#M21608</link>
      <description>&lt;P&gt;Software version: SAS Enterprise Guide 7.1 (64-bit)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;from dataset_A to dataset_B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataset_A :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TYPE QUARTER&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q1&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q2&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2008Q3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q1&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q2&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2008Q3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataset_B: &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;TYPE QUARTER &amp;nbsp; &amp;nbsp;DATE&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/1/2007&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/2/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/31/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2/1/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4/1/2007&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2007Q2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4/2/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/1/2007&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/2/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/31/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2/1/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4/1/2007&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2007Q2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4/2/2007&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried the following code:&lt;/P&gt;&lt;P&gt;proc sort data=work.testing;&lt;BR /&gt;by &lt;SPAN&gt;TYPE&lt;/SPAN&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc expand data=work.testing out=work.testing2&lt;BR /&gt;from=qtr to=month;&lt;BR /&gt;by &lt;SPAN&gt;TYPE&lt;/SPAN&gt;;&lt;BR /&gt;id QUARTER;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However it didn't give a right result, and it has something to do with the new variable DATE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 04:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323249#M21608</guid>
      <dc:creator>ayin</dc:creator>
      <dc:date>2017-01-09T04:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert/expand quarter to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323254#M21609</link>
      <description>&lt;P&gt;Typically one uses PROC EXPAND to "create" intevening records in a time series. These variables are specified in a CONVERT statement. Are you actually trying to do this, or just get the months that correspond to the quarters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 04:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323254#M21609</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-01-09T04:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert/expand quarter to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323256#M21610</link>
      <description>&lt;P&gt;Thanks Tom for the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As we couldn't figure out a simple way to do that, my collegue &lt;STRONG&gt;used excel&lt;/STRONG&gt; to generate a table&amp;nbsp;that &lt;STRONG&gt;lists&amp;nbsp;all dates and its corresponding quarter&lt;/STRONG&gt;, and then she did a &lt;STRONG&gt;left join&lt;/STRONG&gt; in SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 05:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323256#M21610</guid>
      <dc:creator>ayin</dc:creator>
      <dc:date>2017-01-09T05:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert/expand quarter to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323321#M21611</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120587"&gt;@ayin&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I'd like to give "dislike" to this solution &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is really not hard to do with SAS only. See below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input TYPE $ QUARTER:yyq6.;
  format quarter yyq6.;
  datalines;
A 2007Q1
A 2007Q2
A 2008Q3
B 2007Q1
B 2007Q2
B 2008Q3
;
run;

data want;
  set have;
  format date date9.;
  do date=quarter to intnx('quarter',quarter,0,'e');
    output;
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jan 2017 11:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-convert-expand-quarter-to-date/m-p/323321#M21611</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-09T11:09:13Z</dc:date>
    </item>
  </channel>
</rss>

