<?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: Date formatting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407778#M99387</link>
    <description>&lt;P&gt;You can't change the type of a variable, you have to use the correct informat when reading data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

input Code $5. @7 Enddate anydtdte20.;

format Enddate date9.;

datalines;
A4466	December 31, 2016
A7011	December 31, 2015
A7042	December 31, 2014
A7043	December 31, 2014
A9544	December 31, 2016
A9545	December 31, 2016
B9000	December 31, 2016
C1204	December 31, 2013
C1300	December 31, 2014
C1879	June 30, 2013
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Oct 2017 18:48:28 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2017-10-26T18:48:28Z</dc:date>
    <item>
      <title>Date formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407753#M99373</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to solve this issue with date formatting. I just want to make the Enddate variable in a date format. I tried anydtdte and worddate. But all those end up with an error that the format doesnot exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data abcd ;&lt;BR /&gt;set abc ;&lt;BR /&gt;Informat Enddate : anydtdte20.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code Enddate&lt;/P&gt;&lt;TABLE border="1" cellpadding="2"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A4466&lt;/TD&gt;&lt;TD&gt;December 31, 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A7011&lt;/TD&gt;&lt;TD&gt;December 31, 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A7042&lt;/TD&gt;&lt;TD&gt;December 31, 2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A7043&lt;/TD&gt;&lt;TD&gt;December 31, 2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A9544&lt;/TD&gt;&lt;TD&gt;December 31, 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A9545&lt;/TD&gt;&lt;TD&gt;December 31, 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B9000&lt;/TD&gt;&lt;TD&gt;December 31, 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1204&lt;/TD&gt;&lt;TD&gt;December 31, 2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1300&lt;/TD&gt;&lt;TD&gt;December 31, 2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1879&lt;/TD&gt;&lt;TD&gt;June 30, 2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 17:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407753#M99373</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2017-10-26T17:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407778#M99387</link>
      <description>&lt;P&gt;You can't change the type of a variable, you have to use the correct informat when reading data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

input Code $5. @7 Enddate anydtdte20.;

format Enddate date9.;

datalines;
A4466	December 31, 2016
A7011	December 31, 2015
A7042	December 31, 2014
A7043	December 31, 2014
A9544	December 31, 2016
A9545	December 31, 2016
B9000	December 31, 2016
C1204	December 31, 2013
C1300	December 31, 2014
C1879	June 30, 2013
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2017 18:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407778#M99387</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-10-26T18:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407800#M99401</link>
      <description>&lt;P&gt;Hello Andreas. This is the log i get when SAS is run. The End date is in $31 format if it helps for the soulution.&lt;/P&gt;&lt;P&gt;data abcd ;&lt;BR /&gt;118 set abc ;&lt;BR /&gt;119 input Code $5. @7 Enddate anydtdte20.;&lt;BR /&gt;-----------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The informat $ANYDTDTE was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;120 format Enddate date9.;&lt;BR /&gt;------&lt;BR /&gt;&lt;BR /&gt;ERROR 48-59: The format $DATE was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;121 run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.ABCD may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 2 variables.&lt;BR /&gt;WARNING: Data set WORK.ABCD was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 19:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407800#M99401</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2017-10-26T19:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407802#M99403</link>
      <description>&lt;P&gt;If you are working from an existing character variable, instead of a reading from a source text file, then you will want to use the INPUT() function instead of the INPUT statement.&amp;nbsp; You will need to create a new numeric variable to store the date as you cannot store it back into the character variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abcd ;
  set abc ;
  datevar=input(Enddate,anydtdte20.);
  format datevar date9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2017 19:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-formatting/m-p/407802#M99403</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-26T19:23:50Z</dc:date>
    </item>
  </channel>
</rss>

