<?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 to convert YYYY-MM-DD  char variable to date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913484#M360051</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    date_var=input(char_var,yymmdd10.);
    format date_var yymmddd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Jan 2024 23:52:13 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-01-29T23:52:13Z</dc:date>
    <item>
      <title>How to convert YYYY-MM-DD  char variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913483#M360050</link>
      <description>&lt;P&gt;I have a lot of date variables that came out of a database stored as text, in the format YYYY-MM-DD real example : 1998-01-15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. Found examples, and I've found a list of date formats, but none of them match this. The data starts in 1997, so all four year digits are important.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 23:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913483#M360050</guid>
      <dc:creator>TMoseley1980</dc:creator>
      <dc:date>2024-01-29T23:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert YYYY-MM-DD  char variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913484#M360051</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    date_var=input(char_var,yymmdd10.);
    format date_var yymmddd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jan 2024 23:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913484#M360051</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-29T23:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert YYYY-MM-DD  char variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913488#M360052</link>
      <description>&lt;P&gt;Some of the date informats (you don't want a format to read data) are pretty tolerant of characters as long as they are used consistently, as is same between year and month and day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   input string :$10.;
   date_var = input(string,yymmdd10.);
   format date_var yymmddd10.;
datalines;
1998-01-15
1998/01/15
1998*01*15
1998!01!15
1998#01#15
1998\01\15
1998|01|15
1998$01$15
1998^01^15
1998(01(15
1998%01%15
1998&amp;amp;01&amp;amp;15
19980115
;
&lt;/PRE&gt;
&lt;P&gt;While I wouldn't expect to see some of those in most files you might be surprised some time.&lt;/P&gt;
&lt;P&gt;Actually you concern about 4 digit years is well founded and should be thankful all four are provided. It is the idiots that dump something like 010203 with two digit years and you don't know if that is supposed to be 3 Feb 2001 (or 3 Feb 1901), 2 Mar 2001, 1 Feb 2003 or 2 Jan 2003.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 00:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913488#M360052</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-01-30T00:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert YYYY-MM-DD  char variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913495#M360055</link>
      <description>&lt;P&gt;How are these date variables stored in the source database? If their column types are date or datetime at source it could be easier to fix the extract process rather than bandaid the data afterwards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 01:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-YYYY-MM-DD-char-variable-to-date/m-p/913495#M360055</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-30T01:48:08Z</dc:date>
    </item>
  </channel>
</rss>

