<?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: SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627875#M20602</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300616"&gt;@adrfinance&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can you please take the values from a variable instead of using inline?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Datalines and input &lt;U&gt;&lt;STRONG&gt;CREATE A VARIABLE&lt;/STRONG&gt;&lt;/U&gt;, so your question is nonsense.&lt;/P&gt;
&lt;P&gt;If you want to read existing values from a dataset, use the set statement, and the variables from the incoming dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS if you want code that is applicable to your data, it is necessary to supply that data, in a data step with datalines (see the gazillion examples her on the communities).&lt;/P&gt;
&lt;P&gt;Use the "little running man" to post your code.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 12:46:40 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-02-27T12:46:40Z</dc:date>
    <item>
      <title>SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627828#M20591</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset that has date entried in the following form:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2017-06-30&lt;/P&gt;
&lt;P&gt;2017-06-30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and I would like to generate a new variable that has the year and the quarter in the following format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YYYYQQ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e. the above entries would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2017Q2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627828#M20591</guid>
      <dc:creator>adrfinance</dc:creator>
      <dc:date>2020-02-27T10:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627831#M20592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300616"&gt;@adrfinance&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try the YYQ format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input date:YYMMDD10.;
	format date YYQ.;
	datalines;
2017-06-30
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627831#M20592</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-27T10:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627832#M20593</link>
      <description>&lt;P&gt;If the initial variable is a character variable and not a SAS date, you can use the input() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input date $10.;	
	format date_q YYQ.;
	date_q = input(date, YYMMDD10.);
	datalines;
2017-06-30
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627832#M20593</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-27T10:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627835#M20595</link>
      <description>&lt;P&gt;Can you please take the values from a variable instead of using inline?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 10:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627835#M20595</guid>
      <dc:creator>adrfinance</dc:creator>
      <dc:date>2020-02-27T10:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS - create new variable with year quarter in format YYYYQQ from YYYY-MM-DD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627875#M20602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300616"&gt;@adrfinance&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can you please take the values from a variable instead of using inline?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Datalines and input &lt;U&gt;&lt;STRONG&gt;CREATE A VARIABLE&lt;/STRONG&gt;&lt;/U&gt;, so your question is nonsense.&lt;/P&gt;
&lt;P&gt;If you want to read existing values from a dataset, use the set statement, and the variables from the incoming dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS if you want code that is applicable to your data, it is necessary to supply that data, in a data step with datalines (see the gazillion examples her on the communities).&lt;/P&gt;
&lt;P&gt;Use the "little running man" to post your code.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 12:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-create-new-variable-with-year-quarter-in-format-YYYYQQ-from/m-p/627875#M20602</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-27T12:46:40Z</dc:date>
    </item>
  </channel>
</rss>

