<?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 to date in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754907#M1017</link>
    <description>Have used the Substring operator as below but because it's a character the sorting doesn't quite work correctly as dates -&lt;BR /&gt;&lt;BR /&gt;Substring('Start date'n, 1, 10)&lt;BR /&gt;&lt;BR /&gt;Sorry, but I am referring to SAS VA not EG, is there a way to fix in VA?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Mon, 19 Jul 2021 04:54:29 GMT</pubDate>
    <dc:creator>ywon111</dc:creator>
    <dc:date>2021-07-19T04:54:29Z</dc:date>
    <item>
      <title>Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754486#M1011</link>
      <description>&lt;P&gt;I have a &lt;STRONG&gt;Start date&lt;/STRONG&gt; variable as a category and want to turn into a date. Have used RemoveChars to remove the strings but how to convert it to a proper date so it can be sorted correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="381"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="215"&gt;Start date&lt;/TD&gt;
&lt;TD width="166"&gt;Want&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05/04/2021 (abc)&lt;/TD&gt;
&lt;TD&gt;5/04/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05/04/2021 (abc)&lt;/TD&gt;
&lt;TD&gt;5/04/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 04:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754486#M1011</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-07-16T04:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754507#M1012</link>
      <description>&lt;P&gt;Following method can be used to solve the issue :&lt;/P&gt;
&lt;P&gt;date_n=input(substr(start_date,1,10),mmyydd10.);&lt;/P&gt;
&lt;P&gt;format date_n date9.;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 07:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754507#M1012</guid>
      <dc:creator>sas_it</dc:creator>
      <dc:date>2021-07-16T07:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754556#M1013</link>
      <description>&lt;P&gt;A simpler method:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   want_date = input(start_date, mmdyy10.);
   format want_date mmddyys10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jul 2021 11:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754556#M1013</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-07-16T11:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754907#M1017</link>
      <description>Have used the Substring operator as below but because it's a character the sorting doesn't quite work correctly as dates -&lt;BR /&gt;&lt;BR /&gt;Substring('Start date'n, 1, 10)&lt;BR /&gt;&lt;BR /&gt;Sorry, but I am referring to SAS VA not EG, is there a way to fix in VA?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 19 Jul 2021 04:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754907#M1017</guid>
      <dc:creator>ywon111</dc:creator>
      <dc:date>2021-07-19T04:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754909#M1018</link>
      <description>&lt;P&gt;It would be better to fix this before it is loaded into VA using the methods already given&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 05:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754909#M1018</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-07-19T05:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character to date</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754924#M1019</link>
      <description>&lt;P&gt;Data needs to be cleaned before it goes to VA. VA is for&amp;nbsp;&lt;EM&gt;analytics&lt;/EM&gt;, not for ETL.&lt;/P&gt;
&lt;P&gt;And date values HAVE to be stored as such when data is imported into SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 07:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Convert-character-to-date/m-p/754924#M1019</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-19T07:46:42Z</dc:date>
    </item>
  </channel>
</rss>

