New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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