<?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 read date informats in  proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631979#M187305</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how to read date(ddmmyyd10.) in proc sql .&lt;/P&gt;
&lt;P&gt;I have tried below step but I didn't get any value...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values(10-12-2020) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values('10-12-2020'd) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to take informats?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Date literals,&amp;nbsp; "xxxx"d , only work when the text in the quotes can be interpreted by the DATE informat. So assuming 10-12 is December tenth you would use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values('10DEC2020'd) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could use %SYSFUNC() to generate an actual number of days since 1960 and insert that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values(%sysfunc(inputn(10-12-2020,ddmmyy10.)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could even add some more code and generate a date literal, (but why?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values("%sysfunc(inputn(10-12-2020,ddmmyy10.),date9.)"d);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS There is no informat named ddmmyyD.&amp;nbsp; There is a FORMAT with that name, but the informat DDMMYY can read values that use any of the normal delimiters, so there is no need for a specific one for a dash as delimiter.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 17:04:28 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-03-13T17:04:28Z</dc:date>
    <item>
      <title>how to read date informats in  proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631945#M187285</link>
      <description>&lt;P&gt;how to read date(ddmmyyd10.) in proc sql .&lt;/P&gt;
&lt;P&gt;I have tried below step but I didn't get any value...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values(10-12-2020) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values('10-12-2020'd) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to take informats?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 16:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631945#M187285</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-03-13T16:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in  proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631951#M187290</link>
      <description>You must specify data as a SAS date literal in a date9 format. Or use a INPUT() to convert it using the correct informat.</description>
      <pubDate>Fri, 13 Mar 2020 16:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631951#M187290</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-13T16:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631953#M187291</link>
      <description>I got in data step block&lt;BR /&gt;How to do in proc SQL</description>
      <pubDate>Fri, 13 Mar 2020 16:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631953#M187291</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-03-13T16:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631967#M187298</link>
      <description>The same way.</description>
      <pubDate>Fri, 13 Mar 2020 16:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631967#M187298</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-13T16:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in  proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631979#M187305</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how to read date(ddmmyyd10.) in proc sql .&lt;/P&gt;
&lt;P&gt;I have tried below step but I didn't get any value...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values(10-12-2020) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table ex1 (dob informat=ddmmyyd10. format=date9.) ;&lt;BR /&gt;insert into ex1 values('10-12-2020'd) ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to take informats?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Date literals,&amp;nbsp; "xxxx"d , only work when the text in the quotes can be interpreted by the DATE informat. So assuming 10-12 is December tenth you would use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values('10DEC2020'd) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could use %SYSFUNC() to generate an actual number of days since 1960 and insert that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values(%sysfunc(inputn(10-12-2020,ddmmyy10.)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could even add some more code and generate a date literal, (but why?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;insert into ex1 values("%sysfunc(inputn(10-12-2020,ddmmyy10.),date9.)"d);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS There is no informat named ddmmyyD.&amp;nbsp; There is a FORMAT with that name, but the informat DDMMYY can read values that use any of the normal delimiters, so there is no need for a specific one for a dash as delimiter.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 17:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/631979#M187305</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-13T17:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in  proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/632084#M187357</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PS There is no informat named ddmmyyD.&amp;nbsp; There is a FORMAT with that name, but the informat DDMMYY can read values that use any of the normal delimiters, so there is no need for a specific one for a dash as delimiter.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And I really appreciate SAS making DDMMYY, and other similar informats, that flexible.&lt;/P&gt;
&lt;P&gt;I've had to deal with single source files with mixed content like:&lt;/P&gt;
&lt;PRE&gt;data junk;
  input x :ddmmyy10.;
  format x date9.;
datalines;
12/02/2020
12-02-2020
12.02.2020
12022020
12*02*2020
12\02\2020
12|02|2020
;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 21:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/632084#M187357</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-13T21:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to read date informats in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/632135#M187379</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I got in data step block. How to do in proc SQL&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no equivalent to the data step's &lt;FONT face="courier new,courier"&gt;input&lt;/FONT&gt; statement in SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL only accepts the actual value to be inserted, and does not use informats to transform these values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Mar 2020 10:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-date-informats-in-proc-sql/m-p/632135#M187379</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-14T10:48:38Z</dc:date>
    </item>
  </channel>
</rss>

