BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
learner3
Fluorite | Level 6

can anyone write the code to find the differences between those dates.

data arjun;
input startday:$10. endday:$10. ;
datalines;
11jan2012 30jan2012
12jan2012 30jan2012
11mar2012 30mar2012
12apr2012 30may2012
31mar2022 15may2022
31mar2022 25may2022
;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
data want;
  set arjun;
  dif=intck('day',input(startday,date9.),input(endday,date9.));
run;

View solution in original post

3 REPLIES 3
japelin
Rhodochrosite | Level 12
data want;
  set arjun;
  dif=intck('day',input(startday,date9.),input(endday,date9.));
run;
ballardw
Super User

Really want to get in the habit of reading dates as SAS dates and assigning your desired display format. There are several functions that work with dates, times and datetime values, and you can accomplish many analysis, reporting or graphing changes with data by changing the format of the date, time or datetime variables.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 914 views
  • 2 likes
  • 3 in conversation