Hi....I am trying to calculate the number of days from a clients DOB and a date. I am using INTCK Function and it seems to work until the clients DOB falls on a Leap year. Any suggestions to to fix this....Thanks
((intck('Day',input(put(client_dob,8.),yymmdd8.),input(put(date,8.),yymmdd8.),'c'))) as Number_Days
Have you checked your leap years to make sure the dates are valid? For example, if your data set contains 19930229, you should be getting an error because there is no February 29 in the year 1993.
Please post dates to indicate how the results don't match what you're expecting.
Otherwise, simply subtract the two dates to get the number of days.
Have you checked your leap years to make sure the dates are valid? For example, if your data set contains 19930229, you should be getting an error because there is no February 29 in the year 1993.
Hi Astounding....I think you found the problem....the DOB is 19320229 and the birthdate occurring during the fiscal year from 20140401 to 20150331 is probably not a leap year.
No the problem is 1993 is not a leap year, therefore there's no Feb 29th and that's an incorrect DOB, SAS date value.
You have written C in the quatation marks. what is that meant for ?
please help.
((intck('Day',input(put(client_dob,8.),yymmdd8.),input(put(date,8.),yymmdd8.),'c')))
Hi Vandhan,
The 'C' is an optional parameter which refers to the method of 'Continuous'. The alternative method, which is the default method, is 'Discrete'. These optional parameters can be used when calculating the difference between two dates and the 'Continuous' method actually calculates continuous time from the start-of-period date specified in the second parameter of INTCK function.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.