- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have a dataset called Adding_120A. It has EnteredAccountStatusDate column. I want to add a column which shows the number of days between EnteredAccountStatusDate and today's date. I have written a code but it adds a column but there is no data in the column. Below is the code I have written and the Note message from the log.
Data Adding_120A;
Set Adding_120A;
today=today();
No_of_days=intck('d',EnteredAccountStatusDate,today);
run;
NOTE: Invalid argument to function INTCK('d',23023,23064) at line 32 column 12.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There is no interval named D that INTCK() understands. Did you mean to use 'DAY'?
But if you have date values you can just subtract them to calculate day differences. Dates are stored as a number of days and you don't have to use INTCK() or INTNX() when the interval you are using is the basic storage unit of the values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
okay, I changed 'd 'with 'day' and now it is showing the number of days. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS dates are counts of days, so you do not need the INTCK function to determine a difference in days:
No_of_days = today() - EnteredAccountStatusDate;