<?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: Please help - DATDIF with yyyymmdd problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50129#M10461</link>
    <description>Thanks so much for your help, Jason! I appreciate it!&lt;BR /&gt;
&lt;BR /&gt;
I did what u suggested and it works perfectly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Tue, 02 Feb 2010 13:51:03 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-02T13:51:03Z</dc:date>
    <item>
      <title>Please help - DATDIF with yyyymmdd problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50127#M10459</link>
      <description>Hi everyone,&lt;BR /&gt;
&lt;BR /&gt;
This is my first post on this forum and I'd like to kindly ask you to assist me with this problem.&lt;BR /&gt;
&lt;BR /&gt;
In Enterprise Guide I'm writing an SQL statement in which I wan't to (in the select part) get the difference in days between two date values. Both date values/columns are in &lt;B&gt;yyyymmdd&lt;/B&gt; format. Unfortunatelly, the standard sql DATEDIFF function is not working here and I've tried DATDIF but with no luck.&lt;BR /&gt;
&lt;BR /&gt;
It tried something like this:&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
CREATE TABLE EGTASK.MYQUERY&lt;BR /&gt;
AS SELECT DATDIF (START_DATE, END_DATE, 'ACT/ACT'), ...&lt;BR /&gt;
FROM TABLE1;&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I'd appreciate your help very much &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Mon, 01 Feb 2010 16:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50127#M10459</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-01T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Please help - DATDIF with yyyymmdd problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50128#M10460</link>
      <description>If START_DATE and END_DATE are character values, those need to be converted to numeric SAS date values before calling DATDIF.  One way to convert a character value to a numeric value is to use the INPUT function.&lt;BR /&gt;
&lt;BR /&gt;
Here is a small program that uses the INPUT function and the YYMMDD. informat to convert character date values into numeric date values.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data in;&lt;BR /&gt;
  start_date = '20100201'; end_date = '20100204'; output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table out&lt;BR /&gt;
as select&lt;BR /&gt;
  datdif(input(start_date, YYMMDD8.), &lt;BR /&gt;
         input(end_date, YYMMDD8.), &lt;BR /&gt;
         'ACT/ACT') as datdif, &lt;BR /&gt;
  start_date, &lt;BR /&gt;
  end_date&lt;BR /&gt;
from in;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 01 Feb 2010 20:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50128#M10460</guid>
      <dc:creator>JasonS_SAS</dc:creator>
      <dc:date>2010-02-01T20:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Please help - DATDIF with yyyymmdd problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50129#M10461</link>
      <description>Thanks so much for your help, Jason! I appreciate it!&lt;BR /&gt;
&lt;BR /&gt;
I did what u suggested and it works perfectly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 02 Feb 2010 13:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-DATDIF-with-yyyymmdd-problem/m-p/50129#M10461</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-02T13:51:03Z</dc:date>
    </item>
  </channel>
</rss>

