BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

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.
3 REPLIES 3
Tom
Super User Tom
Super User

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.

Sandeep77
Lapis Lazuli | Level 10

okay, I changed 'd 'with 'day' and now it is showing the number of days. Thanks

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 767 views
  • 1 like
  • 3 in conversation