<?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 Extracting month and year from a Date column with format MMDDYY10. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398439#M278391</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Thanks. But how about if one dataset has&amp;nbsp;Date column in month format while other dataset has daily date format. Please suggest me some code so that they both are converted in similar format. I need to extract the values where both datasets' dates are matched.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2017 05:06:56 GMT</pubDate>
    <dc:creator>Saba1</dc:creator>
    <dc:date>2017-09-25T05:06:56Z</dc:date>
    <item>
      <title>SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398344#M278387</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a data set with "Date" column and the format is MMDDYY10. (e.g. 12/31/2010). I want to create another column of "Date_New" with only month and year like 201012. When I apply the following code, I get a column of values 196001 instead of required date format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;/P&gt;&lt;P&gt;date_new&amp;nbsp;= datepart(date);&lt;BR /&gt;FORMAT &lt;SPAN&gt;date_new&lt;/SPAN&gt; yymmn6.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guide me in this regard. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 02:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398344#M278387</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-09-24T02:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398346#M278388</link>
      <description>&lt;P&gt;You ony need to apply the DATEPART function if your original date is a DATETIME. This should get you what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
date_new = date;
FORMAT date_new yymmn6.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Sep 2017 03:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398346#M278388</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-24T03:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398347#M278389</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;That is great. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 03:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398347#M278389</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-09-24T03:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398348#M278390</link>
      <description>&lt;P&gt;You don't need to create a new variable depending on what you need. You can summarize by the year month by using a format in a proc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ie summarize the average open price by month in the STOCKS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.stocks mean;
class date;
format date yymmn6.;
var open;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Sep 2017 03:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398348#M278390</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-24T03:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398439#M278391</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Thanks. But how about if one dataset has&amp;nbsp;Date column in month format while other dataset has daily date format. Please suggest me some code so that they both are converted in similar format. I need to extract the values where both datasets' dates are matched.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 05:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398439#M278391</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-09-25T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398542#M278392</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/166516"&gt;@Saba1&lt;/a&gt;&amp;nbsp;in this case, it's not formats that matter, it's the underlying data. That's an important distinction because formats only control what's displayed. To merge you need to make them the same, ie SAS dates, numeric or character, whichever is appropriate.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 14:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/398542#M278392</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-25T14:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399936#M278393</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; for this useful Information. By the way I have used INTNX to convert daily date into monthly and then&amp;nbsp;merged it easily with Monthly date dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 22:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399936#M278393</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-09-29T22:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399963#M278394</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/166516"&gt;@Saba1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; for this useful Information. By the way I have used INTNX to convert daily date into monthly and then&amp;nbsp;merged it easily with Monthly date dataset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INTNX returns a date, it may be formatted to look like a month, but it's still a date variable. If the day portion is different the data will not merge correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a key differentiation in how SAS handles data that is very important to understand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 02:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399963#M278394</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-30T02:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399969#M278395</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Actually in one of my dataset an event is occuring in different days of various months . The other dataset is monthly return. I need to convert those "daily dates" of events into mothly (month end) and then match with monthly returns whereever the dates are similar. In this way I&amp;nbsp;analyse the effect of event on return. Therefore I have used INTNX because I want to&amp;nbsp;convert daily sates into monthly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 03:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/399969#M278395</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2017-09-30T03:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Extracting month and year from a Date column with format MMDDYY10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/523493#M278396</link>
      <description>This is getting into semantics but I'll still clarify in case you run into this again. SAS doesn't have dates without a day value. So what you've done is aligned your dates to be the same, for example the beginning or end of the month to allow them to merge which is the correct method. But you have not actually converted a "daily" date into a "monthly" date. Hope that helps to clarify this and Merry Christmas.</description>
      <pubDate>Tue, 25 Dec 2018 19:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Extracting-month-and-year-from-a-Date-column-with-format/m-p/523493#M278396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-25T19:24:19Z</dc:date>
    </item>
  </channel>
</rss>

