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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 813 views
  • 1 like
  • 3 in conversation