<?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 Date difference using SAS  INTCK in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755564#M30005</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am calculating difference in days between diagnosis date and first lab test date using intck, but my code is not working right. Two of my date variables are numeric in MMDDYYYY format. This is a longitudinal data and I need to retrieve the difference between these two dates based on the very first lab test right after the diagnosis date. So, I have two issues here, one I am not sure how to use the intck function correctly and secondly how to select only the first labdate right after the diagnosis date. I have been asked to use only intck function, please keep in mind. This is a big data set with millions of records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code and this is what I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_sad_1-1626845794140.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61478i32DA5159EE083486/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_sad_1-1626845794140.png" alt="sas_sad_1-1626845794140.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_sad_0-1626845676506.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61477iFC3F5387FD014C32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_sad_0-1626845676506.png" alt="sas_sad_0-1626845676506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 05:40:52 GMT</pubDate>
    <dc:creator>sas_sad</dc:creator>
    <dc:date>2021-07-21T05:40:52Z</dc:date>
    <item>
      <title>Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755564#M30005</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am calculating difference in days between diagnosis date and first lab test date using intck, but my code is not working right. Two of my date variables are numeric in MMDDYYYY format. This is a longitudinal data and I need to retrieve the difference between these two dates based on the very first lab test right after the diagnosis date. So, I have two issues here, one I am not sure how to use the intck function correctly and secondly how to select only the first labdate right after the diagnosis date. I have been asked to use only intck function, please keep in mind. This is a big data set with millions of records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code and this is what I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_sad_1-1626845794140.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61478i32DA5159EE083486/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_sad_1-1626845794140.png" alt="sas_sad_1-1626845794140.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas_sad_0-1626845676506.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61477iFC3F5387FD014C32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas_sad_0-1626845676506.png" alt="sas_sad_0-1626845676506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 05:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755564#M30005</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T05:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755568#M30006</link>
      <description>&lt;P&gt;Does your log say anything about conversion of character to numeric values? You might see something like:&lt;/P&gt;
&lt;PRE&gt;NOTE: Character values have been converted to numeric values at the places given by:
      (Line):(Column).
&lt;/PRE&gt;
&lt;P&gt;If so you do not have date variables at all, you have character variables that need to be turned into actual SAS values before using the INTCK function.&lt;/P&gt;
&lt;P&gt;Or do you get something like&lt;/P&gt;
&lt;PRE&gt;NOTE: Invalid argument to function INTCK('day',7152021,7212021) at line XX column YY.
&lt;/PRE&gt;
&lt;P&gt;That will happen you have simple numeric values that look like 07152021. They are also not date values.&lt;/P&gt;
&lt;P&gt;We need to see which actual values you have to recommend which code is needed to create date values.&lt;/P&gt;
&lt;P&gt;Examples converting character or numeric values that look like you say they might:&lt;/P&gt;
&lt;PRE&gt;  data junk;
     x='07152021';
     y=7212021;
     /* character value*/
     newx=input(x,mmddyy10.);
     /*numeric value*/
     newy=input(put(y,z8.),mmddyy10.);
     format newx newy mmddyy10.;
     z = intck('day',newx,newy);
  run;&lt;/PRE&gt;
&lt;P&gt;Please save yourself some trouble and don't make pictures of code or log results. Copy text from the editor or log and on the forum open a text box using the &amp;lt;/&amp;gt; icon that appears above the message window. Then paste the code.&lt;/P&gt;
&lt;P&gt;It is much easier to point out needed changes to code when it is text. If there are enough issues with code some of us will not take the time to retype log sections to make multiple minor changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, read the log. Really, it is very helpful. If you see something in the log you don't understand, copy the code and the messages from the log and paste into text box. The text box is important because the main message windows will reformat text and may mean that some of the diagnostics that SAS supplies will not appear correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When unexpected results, such as a bunch of missing values are generated one of the first things is to make sure that the variables and the values you are using are appropriate for the function. In the case of date related functions you need 1) numeric variables and 2) in specific ranges. SAS dates are the number of days since 1 Jan 1960. So if you have a number like 07152021 that would the year 21,705. For some likely very good reasons none of the SAS date functions work with dates past year 20,000. Proc contents will help. If the variable type is character it is pretty obvious what needs to be done. If the type is numeric but the format is something like BEST12. or F12. then you have plain number and seldom will it resolve with date functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt; has a PDF with much information about dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is best to p&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 06:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755568#M30006</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-21T06:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755569#M30007</link>
      <description>&lt;P&gt;Problem: Your data step has no set-statement.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 06:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755569#M30007</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-21T06:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755593#M30013</link>
      <description>Thank you, here is the log when I run this code. My dates are numeric in MMDDYYY format like 02/05/2019. Should I change it to sas dates and remove the missing dates as the log says?&lt;BR /&gt;&lt;BR /&gt;data hiv;&lt;BR /&gt;no_of_days = intck ('DAY',hivdiag_date,labdate);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Variable hivdiag_date is uninitialized.&lt;BR /&gt;NOTE: Variable labdate is uninitialized.&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;1 at 51:14&lt;BR /&gt;NOTE: The data set WORK.HIV has 1 observations and 3 variables.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2021 11:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755593#M30013</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T11:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755595#M30015</link>
      <description />
      <pubDate>Wed, 21 Jul 2021 11:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755595#M30015</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T11:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755596#M30016</link>
      <description>&lt;P&gt;Because of the missing SET statement, you have no "incoming" variables, so they are created on the fly and set to missing.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 11:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755596#M30016</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-21T11:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755597#M30017</link>
      <description>&lt;PRE&gt;data hiv;
no_of_days = intck ('DAY',hivdiag_date,labdate);
run;

NOTE: Variable hivdiag_date is uninitialized.
NOTE: Variable labdate is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 51:14
NOTE: The data set WORK.HIV has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.08 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 11:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755597#M30017</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T11:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755600#M30019</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two people have pointed out you have no SET statement, so your variables hivdiag_date and labdate don't have values. You need to fix that.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 11:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755600#M30019</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-21T11:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755601#M30020</link>
      <description>I used the set statement but still gives the same result.</description>
      <pubDate>Wed, 21 Jul 2021 12:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755601#M30020</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T12:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755602#M30021</link>
      <description>I did, still gives the same result. Does not give any result for the difference in days.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755602#M30021</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T12:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755603#M30022</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I used the set statement but still gives the same result.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;, here's an important concept. When you have code that doesn't work, SHOW US the LOG so we can see the code you used, as it appears in the LOG, plus all ERRORs, WARNINGs and NOTEs. Do not pick and choose parts of the log to show us, show us ALL of it, every single character of the LOG, for the code in question. (This should be done every single time from now on, without us asking to see the LOG)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another important concept: If you tell us something doesn't work, and provide no other information, we cannot help you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755603#M30022</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-21T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755605#M30023</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I did, still gives the same result. Does not give any result for the difference in days.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But you haven't shown the log from any runs that actually used any data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if your variables are dates (the number of days since 1960) then you can get the difference in days by simple subtraction.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  diff = date1 - date2 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755605#M30023</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-21T12:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755606#M30024</link>
      <description>&lt;PRE&gt;data hiv1;
set hiv;
no_of_days = intck ('DAY',hivdiag_date,labdate);
run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      2603 at 60:14
NOTE: There were 2995385 observations read from the data set WORK.HIV.
NOTE: The data set WORK.HIV1 has 2995385 observations and 364 variables.
NOTE: DATA statement used (Total process time):
      real time           21.77 seconds
      cpu time            0.85 seconds

&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755606#M30024</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T12:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755609#M30025</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;data hiv1;
set hiv;
no_of_days = intck ('DAY',hivdiag_date,labdate);
run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      2603 at 60:14
NOTE: There were 2995385 observations read from the data set WORK.HIV.
NOTE: The data set WORK.HIV1 has 2995385 observations and 364 variables.
NOTE: DATA statement used (Total process time):
      real time           21.77 seconds
      cpu time            0.85 seconds

&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you got it to work.&lt;/P&gt;
&lt;P&gt;The note is saying that in 2,603 observations out of your 2,995,385 total observations one or more of your dates was missing.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:28:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755609#M30025</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-21T12:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755610#M30026</link>
      <description>I posted my log above, I used the set statement, still nothing.</description>
      <pubDate>Wed, 21 Jul 2021 12:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755610#M30026</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T12:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755611#M30027</link>
      <description>No, but it does not give me difference in days between diagnosis date and lab test date.</description>
      <pubDate>Wed, 21 Jul 2021 12:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755611#M30027</guid>
      <dc:creator>sas_sad</dc:creator>
      <dc:date>2021-07-21T12:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755612#M30028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No, but it does not give me difference in days between diagnosis date and lab test date.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How can you tell?&amp;nbsp; &amp;nbsp;What do you get it you use PROC MEANS to look a the min/max/mean of your new calculated variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at your original dataset. How are those two "date" variables defined.&lt;/P&gt;
&lt;P&gt;Since you didn't get any message about converting characters to number then the two variable are numeric.&amp;nbsp; But what types of values do they contain.&amp;nbsp; SAS stores dates as the number of days since 1960.&amp;nbsp; To make the number look readable to humans you need to attach for format like DATE or YYMMDD to the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some people create "date" variables that actual contain a datetime (or timestamp) value instead.&amp;nbsp; SAS stores those as the number of seconds since 1960.&amp;nbsp; If you want to calculate the number of days between two datetime values with INTCK() you need to use the DTDAY interval and not the DAY interval.&amp;nbsp; If one is DATE and the other is DATETIME then you need to convert one of them before comparing them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometime people also create numeric variables with integer values like 20,210,721 and think those are date because they look like YYYYMMDD values when printed.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755612#M30028</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-21T12:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference using SAS  INTCK</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755615#M30029</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66964"&gt;@sas_sad&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I posted my log above, I used the set statement, still nothing.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As before, saying it doesn't work and NOT EXPLAINING doesn't help us and doesn't help us help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by "still nothing". Can you SHOW US what you see that indicates "still nothing"?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 12:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Date-difference-using-SAS-INTCK/m-p/755615#M30029</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-21T12:46:28Z</dc:date>
    </item>
  </channel>
</rss>

