<?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: convert character date to YYMMDD10. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627236#M185098</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for you help!&lt;/P&gt;
&lt;P&gt;your code also worked!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 16:33:45 GMT</pubDate>
    <dc:creator>superbug</dc:creator>
    <dc:date>2020-02-25T16:33:45Z</dc:date>
    <item>
      <title>convert character date to YYMMDD10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627189#M185076</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have character date&amp;nbsp; 01/29/2019 (format $10, informat $10). I want to convert it into 2019-01-29. I searched online and tried different ways, but still not successful.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please help.&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 14:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627189#M185076</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-02-25T14:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: convert character date to YYMMDD10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627190#M185077</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have character date&amp;nbsp; 01/29/2019 (format $10, informat $10). I want to convert it into 2019-01-29. I searched online and tried different ways, but still not successful.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please help.&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you want to create an actual date variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date_var=input(char_var,mmddyy10.);
format date_var yymmdd10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or another character variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;char_var2=put(input(char_var,mmddyy10.),yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 14:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627190#M185077</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-25T14:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: convert character date to YYMMDD10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627191#M185078</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want another character variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you code worked!&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 14:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627191#M185078</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-02-25T14:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert character date to YYMMDD10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627199#M185081</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You need to create a new numeric variable using the INPUT function, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="convert_char_date.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36390i6F3BE9841265D7B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="convert_char_date.png" alt="convert_char_date.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the above program, the variable CDATE is the character date from the input data. The variable BIRTHDAY is the numeric value that is the result of using the INPUT function on CDATE with the mmddyy10. informat. The INPUT function returns the value of the date as the number of days since Jan 1, 1960, which is how SAS date values are stored. The variables BDAY1 and BDAY2 are just copies of the BIRTHDAY variable so a different format can be applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the PROC PRINT, there's no format applied to BIRTHDAY, so you can see how the value for the date is stored internally. Then, BDAY1 is formatted with the yymmdd10. format and BDAY2 is formatted with the worddate. format. The benefit of storing a date value as an offset from Jan 1 1960 is that the same number can use different formats to display the date however you wish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 15:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627199#M185081</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-02-25T15:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: convert character date to YYMMDD10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627236#M185098</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for you help!&lt;/P&gt;
&lt;P&gt;your code also worked!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 16:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-character-date-to-YYMMDD10/m-p/627236#M185098</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-02-25T16:33:45Z</dc:date>
    </item>
  </channel>
</rss>

