<?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: format a date variable in to JAN18(monthyear) format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424918#M104629</link>
    <description>&lt;P&gt;Thanks..It works.&lt;/P&gt;&lt;P&gt;Thanks for the explanation also&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2018 14:08:21 GMT</pubDate>
    <dc:creator>chithra</dc:creator>
    <dc:date>2018-01-04T14:08:21Z</dc:date>
    <item>
      <title>format a date variable in to JAN18(monthyear) format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424906#M104623</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; need to convert the date format variable in to month-year format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04JAN18:10:22:00(type=date)----&amp;gt;JAN18(type=date)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date_format.PNG" style="width: 253px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17645i3B4DA73927EA0339/image-size/large?v=v2&amp;amp;px=999" role="button" title="date_format.PNG" alt="date_format.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 13:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424906#M104623</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2018-01-04T13:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: format a date variable in to JAN18(monthyear) format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424911#M104625</link>
      <description>&lt;P&gt;Type=date - you don't seem to understand what a date or time actually is.&amp;nbsp; Dates are stored as the number of days since a certain timepoint, so all dates are stored this way.&amp;nbsp; Same with times, number of seconds since midnight.&amp;nbsp; Both are numbers, which can be formatted in different ways.&amp;nbsp; So if your Created variable is indeed numeric then you should be able to do:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  new_created=datepart(created);
  format new_created monyy5.;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jan 2018 13:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424911#M104625</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-04T13:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: format a date variable in to JAN18(monthyear) format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424912#M104626</link>
      <description>&lt;P&gt;04JAN18:10:22:00 is not a date value, but a datetime value.&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = datepart(oldvar):
format newvar monyy5.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jan 2018 13:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424912#M104626</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-04T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: format a date variable in to JAN18(monthyear) format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424916#M104627</link>
      <description>&lt;P&gt;Date variables are not stored in a formatted way. They are stored numerically as the number of days since 01JAN1960. Only when presenting them in a report or a table viewer a format is used. Conversion is not needed when you want to reconsider the presentation format of your variable. In your case the format MONYY5. would the appropriate one. MONYY7. would also print the century.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats are a fundamental concept in SAS.&amp;nbsp;Have a look at &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n11m54nggvjybhn1w2a8mbczw04q.htm" target="_blank"&gt;the doc&lt;/A&gt; if you want to read up on how they are used in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-- Jan.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 14:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424916#M104627</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2018-01-04T14:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: format a date variable in to JAN18(monthyear) format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424918#M104629</link>
      <description>&lt;P&gt;Thanks..It works.&lt;/P&gt;&lt;P&gt;Thanks for the explanation also&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 14:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-a-date-variable-in-to-JAN18-monthyear-format/m-p/424918#M104629</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2018-01-04T14:08:21Z</dc:date>
    </item>
  </channel>
</rss>

