<?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: days difference in two dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585639#M167054</link>
    <description>&lt;P&gt;A few things to consider and examine to why that's happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. check whether your date variables are character or numeric. A proc contents will give you this information. If it is character. convert to numeric in a new assignment variable.&lt;/P&gt;
&lt;P&gt;2. Looking at proc contents you could also determine whether your date variables are &lt;STRONG&gt;Datetime&lt;/STRONG&gt;&lt;EM&gt;(number of seconds from jan 1,1960)&lt;/EM&gt; values or &lt;STRONG&gt;date&lt;/STRONG&gt; values&lt;EM&gt;(number of days from jan 1,1960) &lt;/EM&gt;by looking at the format. If it is datetime use&lt;EM&gt;&lt;STRONG&gt; 'dtdays'&lt;/STRONG&gt;&lt;/EM&gt; interval.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Check if there are missing values.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2019 17:45:15 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-09-02T17:45:15Z</dc:date>
    <item>
      <title>days difference in two dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585638#M167053</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Calculating timeframe between treatment and diagnosis*/
data CDCSTVST.CDC_Site_Timeframe;
set CDCSTVST.CDC_Site_SAS_Positive_Only;
days=(INTCK('days', colldate, Treatment_Date));
put days=;
run;

I am using the code above to calculate days between diagnosis and treatment. it is giving me . (blank) in days column.
please help&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Sep 2019 17:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585638#M167053</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2019-09-02T17:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: days difference in two dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585639#M167054</link>
      <description>&lt;P&gt;A few things to consider and examine to why that's happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. check whether your date variables are character or numeric. A proc contents will give you this information. If it is character. convert to numeric in a new assignment variable.&lt;/P&gt;
&lt;P&gt;2. Looking at proc contents you could also determine whether your date variables are &lt;STRONG&gt;Datetime&lt;/STRONG&gt;&lt;EM&gt;(number of seconds from jan 1,1960)&lt;/EM&gt; values or &lt;STRONG&gt;date&lt;/STRONG&gt; values&lt;EM&gt;(number of days from jan 1,1960) &lt;/EM&gt;by looking at the format. If it is datetime use&lt;EM&gt;&lt;STRONG&gt; 'dtdays'&lt;/STRONG&gt;&lt;/EM&gt; interval.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Check if there are missing values.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 17:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585639#M167054</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-02T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: days difference in two dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585640#M167055</link>
      <description>Thank you for your quick response, both dates are MMDDYY10. Format&lt;BR /&gt;Alphabetic List of Variables and Attributes&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Variable&lt;BR /&gt;&lt;BR /&gt;Type&lt;BR /&gt;&lt;BR /&gt;Len&lt;BR /&gt;&lt;BR /&gt;Format&lt;BR /&gt;&lt;BR /&gt;Label&lt;BR /&gt;&lt;BR /&gt;1&lt;BR /&gt;&lt;BR /&gt;IncidentID&lt;BR /&gt;&lt;BR /&gt;Num&lt;BR /&gt;&lt;BR /&gt;8&lt;BR /&gt;&lt;BR /&gt;BEST.&lt;BR /&gt;&lt;BR /&gt;IncidentID&lt;BR /&gt;&lt;BR /&gt;7&lt;BR /&gt;&lt;BR /&gt;Result&lt;BR /&gt;&lt;BR /&gt;Char&lt;BR /&gt;&lt;BR /&gt;58&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;5&lt;BR /&gt;&lt;BR /&gt;Specimen&lt;BR /&gt;&lt;BR /&gt;Char&lt;BR /&gt;&lt;BR /&gt;12&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;6&lt;BR /&gt;&lt;BR /&gt;TestType&lt;BR /&gt;&lt;BR /&gt;Char&lt;BR /&gt;&lt;BR /&gt;41&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3&lt;BR /&gt;&lt;BR /&gt;Treatment_Date1&lt;BR /&gt;&lt;BR /&gt;Num&lt;BR /&gt;&lt;BR /&gt;8&lt;BR /&gt;&lt;BR /&gt;MMDDYY10.&lt;BR /&gt;&lt;BR /&gt;Treatment_Date1&lt;BR /&gt;&lt;BR /&gt;2&lt;BR /&gt;&lt;BR /&gt;case&lt;BR /&gt;&lt;BR /&gt;Char&lt;BR /&gt;&lt;BR /&gt;8&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4&lt;BR /&gt;&lt;BR /&gt;colldate&lt;BR /&gt;&lt;BR /&gt;Num&lt;BR /&gt;&lt;BR /&gt;8&lt;BR /&gt;&lt;BR /&gt;MMDDYY10.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Sep 2019 17:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585640#M167055</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2019-09-02T17:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: days difference in two dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585641#M167056</link>
      <description>&lt;P&gt;Ok great. So it appears both are numeric SAS dates that are formatted as mmddyy10.&amp;nbsp; Have you checked for missing values? You could use a filter for missing and count. Determine the ratio of missing to non missing, and missing to total count.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212762"&gt;@Dhana18&lt;/a&gt;&amp;nbsp;. Your proc contents report has&amp;nbsp;&lt;SPAN&gt;Treatment_Date&lt;STRONG&gt;1&lt;/STRONG&gt; with 1 as suffix to the name while your code has&amp;nbsp;Treatment_Date&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;days&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;INTCK&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'days'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; colldate&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; Treatment_Date&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that a typo?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 17:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585641#M167056</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-02T17:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: days difference in two dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585643#M167058</link>
      <description>&lt;P&gt;If I am understanding your reply above, you have a variable named TREATMENT_DATE1, but your code refers to TREATMENT_DATE which doesn't exist. Could that be it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show us the LOG for this data step code (not just the ERROR or WARNING messages) by pasting the log as text into the window that appears when you click on the {i} icon.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 17:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-difference-in-two-dates/m-p/585643#M167058</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-02T17:56:26Z</dc:date>
    </item>
  </channel>
</rss>

