<?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: How can I convert mixed type of date's to yymmdd10.? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590309#M15020</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;I found the Solution of my question: :) &lt;BR /&gt;&lt;BR /&gt;data want;
input date $20.;
a1=put(input(date,anydtdte12.),yymmdd10.);
cards;
21may2019
21-may-2012
21/may/2013
21-may-2014
21-may-12
12/21/2018
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Sep 2019 10:09:37 GMT</pubDate>
    <dc:creator>rajeshalwayswel</dc:creator>
    <dc:date>2019-09-20T10:09:37Z</dc:date>
    <item>
      <title>How can I convert mixed type of date's to yymmdd10.?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590305#M15019</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date $20.;
cards;
21may2019
21-may-2012
21/may/2013
21-may-2014
21-may-12
12/21/2018
run;

want:
2019-05-21
2012-05-21
2013-05-21
2014-05-21
2012-05-21
2018-12-21&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 09:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590305#M15019</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2019-09-20T09:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert mixed type of date's to yymmdd10.?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590309#M15020</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;I found the Solution of my question: :) &lt;BR /&gt;&lt;BR /&gt;data want;
input date $20.;
a1=put(input(date,anydtdte12.),yymmdd10.);
cards;
21may2019
21-may-2012
21/may/2013
21-may-2014
21-may-12
12/21/2018
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 10:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590309#M15020</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2019-09-20T10:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert mixed type of date's to yymmdd10.?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590554#M15069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;I found the Solution of my question: :) &lt;BR /&gt;&lt;BR /&gt;data want;
input date $20.;
a1=put(input(date,anydtdte12.),yymmdd10.);
cards;
21may2019
21-may-2012
21/may/2013
21-may-2014
21-may-12
12/21/2018
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would suggest that you leave the date as a date value instead of creating a text version using the Put function and assign the format to the variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
input date $20.;
a1=  input(date,anydtdte12.);
format a1 yymmdd10.;
cards;
21may2019
21-may-2012
21/may/2013
21-may-2014
21-may-12
12/21/2018
run;&lt;/PRE&gt;
&lt;P&gt;Then if you need to manipulate the date such as extract values, such as the year, month, day of the year, day of the week and such then you can use an appropriate function, or increment a date, or determine the value between two dates then the functions Intnx or Intck come into play.&lt;/P&gt;
&lt;P&gt;Also for some analysis, reporting or graphing you can change or create groups&amp;nbsp;simply by changing the format&lt;/P&gt;
&lt;P&gt;Example: (You should have the Sashelp.stocks data set available). The default format for the date variable in this data set is Date7 and represents the first stock trading day of the month.&lt;/P&gt;
&lt;P&gt;But I want to examine the behavior of a variable by the calendar year. So&lt;/P&gt;
&lt;PRE&gt;Proc means data=sashelp.stocks max min mean;
   class stock date;
   format date year4.;
   var open;
run;&lt;/PRE&gt;
&lt;P&gt;Will show the maximum, minimum and mean value of the stock opening price for each calendar year in the data for each stock.&lt;/P&gt;
&lt;P&gt;I didn't have to add any variables to create the new group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 22:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-I-convert-mixed-type-of-date-s-to-yymmdd10/m-p/590554#M15069</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-20T22:27:11Z</dc:date>
    </item>
  </channel>
</rss>

