<?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 SAS won't let me create a datetime column. Log says I'm misspelling date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339028#M77313</link>
    <description>&lt;P&gt;Using Enterprise Guide.&lt;/P&gt;&lt;P&gt;When I run the attached code, I get the following (relevant snips) in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;24 create table test (valid_from datetime format=datetime20.);&lt;BR /&gt;________&lt;BR /&gt;1&lt;BR /&gt;WARNING 1-322: Assuming the symbol DATE was misspelled as datetime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table WORK.TEST( bufsize=8192 )&lt;BR /&gt;(&lt;BR /&gt;valid_from num format=DATETIME20. informat=DATE.&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;30 quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I create datetime columns?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table test (valid_from datetime format=datetime20.);
quit;


proc sql;
 describe table test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Mar 2017 21:55:50 GMT</pubDate>
    <dc:creator>Datino</dc:creator>
    <dc:date>2017-03-07T21:55:50Z</dc:date>
    <item>
      <title>SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339028#M77313</link>
      <description>&lt;P&gt;Using Enterprise Guide.&lt;/P&gt;&lt;P&gt;When I run the attached code, I get the following (relevant snips) in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;24 create table test (valid_from datetime format=datetime20.);&lt;BR /&gt;________&lt;BR /&gt;1&lt;BR /&gt;WARNING 1-322: Assuming the symbol DATE was misspelled as datetime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table WORK.TEST( bufsize=8192 )&lt;BR /&gt;(&lt;BR /&gt;valid_from num format=DATETIME20. informat=DATE.&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;30 quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I create datetime columns?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table test (valid_from datetime format=datetime20.);
quit;


proc sql;
 describe table test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 21:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339028#M77313</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-03-07T21:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339029#M77314</link>
      <description>&lt;P&gt;Just specify "num" instead of datetime. Datetime values are just numeric fields, so as long as you're populating the tables with valid SAS datetime values you should be fine.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339029#M77314</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-07T22:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339030#M77315</link>
      <description>&lt;P&gt;There is no datetime type in SAS, only numbers and characters. Change it to NUM and it works like a charm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Datetime is the number of seconds from Jan 1, 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table test (valid_from num format=datetime20.);
quit;


proc sql;
 describe table test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339030#M77315</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-07T22:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339031#M77316</link>
      <description>&lt;P&gt;e.g.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table test (valid_from num format=datetime20.);
quit;

proc sql;
 describe table test;

 insert into test
 values('01JUN2015:00:12:00'dt);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339031#M77316</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-07T22:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339032#M77317</link>
      <description>&lt;P&gt;A datetime value is stored in a numeric variable. Just use any of the aliases that PROC SQL accepts for a number.&lt;/P&gt;
&lt;PRE&gt;Syntax error, expecting one of the following: 
CHAR, CHARACTER, DATE, DEC, DECIMAL, FLOAT, INT
, INTEGER, NUM, NUMERIC, REAL, SMALLINT, VARCHAR.&lt;/PRE&gt;
&lt;P&gt;So anything except CHAR, CHARACTER or VARCHAR will work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table test (valid_from real format=datetime20.);
  describe table test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could just create the table using a data step, no need to bother with SQL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;
  attrib valid_from format=datetime20.;
  stop;
run;
proc contents data=test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339032#M77317</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-07T22:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339035#M77318</link>
      <description>&lt;P&gt;Thank you, I thought the logical thing would be to declare the type like one does with date columns, I was wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339035#M77318</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-03-07T22:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS won't let me create a datetime column. Log says I'm misspelling date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339037#M77320</link>
      <description>&lt;P&gt;Dates are numbers too, not a type either.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 22:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-won-t-let-me-create-a-datetime-column-Log-says-I-m/m-p/339037#M77320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-07T22:16:43Z</dc:date>
    </item>
  </channel>
</rss>

