<?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 date value as character  from date field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502365#M134102</link>
    <description>&lt;P&gt;Use a yymmddd10. format and extract the last 5 characters with substr(.....,6).&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 12:13:24 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-10-08T12:13:24Z</dc:date>
    <item>
      <title>Extract Month and date value as character  from date field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502364#M134101</link>
      <description>&lt;P&gt;Previously I used to extract month and date field as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NEW_RENEWAL_DAY_MONTH_YEAR=mdy(NEW_RENEWAL_MONTH,NEW_RENEWAL_DAY,RENEWAL_YEAR);
format DATE5.;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then I convert the date field to character as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NEW_RENEWAL_DAY_MONTH_YEAR_char=put(NEW_RENEWAL_DAY_MONTH_YEAR,date5.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So that the output will be like 21NOV or 31DEC ... in character. Now the requirement is to get the values like 11-21 or 12-31. Since we do not have any formats like mmdd5. or similar format, I'm not certain how to achieve this. Please guide me.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 12:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502364#M134101</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-08T12:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Month and date value as character  from date field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502365#M134102</link>
      <description>&lt;P&gt;Use a yymmddd10. format and extract the last 5 characters with substr(.....,6).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 12:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502365#M134102</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-08T12:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Month and date value as character  from date field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502369#M134105</link>
      <description>&lt;P&gt;I would ask why you want only day-month in either format.&amp;nbsp; Unless you have specific (very) data, then that date part is going to be pretty useless.&amp;nbsp; Why not just put a proper date on there and be done with it, yymmdd10 gives a nice sortable (in directory views and such like), and ISO dates are pretty standard now.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 12:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502369#M134105</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-08T12:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Month and date value as character  from date field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502444#M134126</link>
      <description>&lt;P&gt;A trick for brevity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length newvar $ 5;&lt;/P&gt;
&lt;P&gt;newvar = put(new_renewal_day_month_year, mmddyyd10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is only room to store the first five characters, so that's going to be the result.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 16:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502444#M134126</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-08T16:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Month and date value as character  from date field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502451#M134129</link>
      <description>&lt;P&gt;data HAVE;&lt;BR /&gt;input date DATE9.;&lt;BR /&gt;FORMAT DATE MMDDYYD10.;&lt;BR /&gt;datalines;&lt;BR /&gt;31DEC2018&lt;BR /&gt;21NOV2018&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;BR /&gt;SET HAVE;&lt;BR /&gt;NEW_D=SUBSTR(PUT(DATE,MMDDYYD10.),1,5);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 16:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-Month-and-date-value-as-character-from-date-field/m-p/502451#M134129</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-08T16:59:03Z</dc:date>
    </item>
  </channel>
</rss>

