Hi, I'm a new user of SAS and my question may be basic. I want to calculate a duration. I want to substract my first date of sampling from my last date of sampling. And I want to know how many days have passed between these two dates. My dates are numeric values. Here is what I've tried so far....Thanks you very much for your help!!

duration = Datemax - Datemin;
gives you the duration in seconds.
To get the number of days, you divide by ... well, you can figure out that, I'm sure.
duration = Datemax - Datemin;
gives you the duration in seconds.
To get the number of days, you divide by ... well, you can figure out that, I'm sure.
Thank you!!!
In addition to @PaigeMiller 's comment, there is no need to use the input() function as your dates are already numeric.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.