<?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: extract month and year from different date formates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867221#M342492</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dates_format;
input id dates anydtdte32.; 
format dates date9. dates DATE5.;
datalines;
1 10/1/2022
2 23march2023
3 11-feb-2022
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;date and month&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 10:16:55 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2023-03-30T10:16:55Z</dc:date>
    <item>
      <title>extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867211#M342483</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dates_format;
input id dates anydtdte32.;
format dates date9. month_year mmyyyy.;
month_year=substr(dates,3);
datalines;
1 10/1/2022
2 23march2023
3 11-feb-2022
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi guys ,&lt;/P&gt;
&lt;P&gt;how to get month and year from different date formats&amp;nbsp;&lt;/P&gt;
&lt;P&gt;requiered output:&lt;/P&gt;
&lt;P&gt;jan2022&lt;/P&gt;
&lt;P&gt;march2023&lt;/P&gt;
&lt;P&gt;feb2022&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867211#M342483</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-30T09:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867212#M342484</link>
      <description>&lt;P&gt;Use the MONYY7. Format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dates_format;
input id dates anydtdte32.;
format dates monyy7.;
datalines;
1 10/1/2022
2 23march2023
3 11-feb-2022
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867212#M342484</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-03-30T09:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867213#M342485</link>
      <description>&lt;P&gt;You have assigned a format that you don't want to use for variable DATES. You don't want it as format DATE9. you want it as format MONYY7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dates_format;
input id dates anydtdte32.;
format dates monyy7.;
datalines;
1 10/1/2022
2 23march2023
3 11-feb-2022
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867213#M342485</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-30T09:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867216#M342487</link>
      <description>&lt;P&gt;Thank you Miller&lt;/P&gt;
&lt;P&gt;if we want extract date and month the which format&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867216#M342487</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-30T10:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867217#M342488</link>
      <description>&lt;P&gt;Thank you peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for you solution&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867217#M342488</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-30T10:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867219#M342490</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if we want extract date and month the which format&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;what would it look like?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867219#M342490</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-30T10:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867221#M342492</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dates_format;
input id dates anydtdte32.; 
format dates date9. dates DATE5.;
datalines;
1 10/1/2022
2 23march2023
3 11-feb-2022
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;date and month&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867221#M342492</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-03-30T10:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: extract month and year from different date formates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867222#M342493</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;
&lt;P&gt;&amp;nbsp;date and month&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I asked "What would it look like?", you haven't shown us what the desired output would look like. Show us.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-month-and-year-from-different-date-formates/m-p/867222#M342493</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-30T10:22:48Z</dc:date>
    </item>
  </channel>
</rss>

