07-02-2017 02:22 PM - last edited on 07-02-2017 02:26 PM by Reeza
Here Date is a set of different dates defined in d_mtcars dataset and I am trying to find the number of days between Date and last_date. But, the values in the days column are missing as output. Please help.
data date_mtcars; set character_mtcars(drop=prefix); set d_mtcars; last_date='29july2017'; days= intck ('day',Date,last_date); run; proc print data=date_mtcars; run;
07-02-2017 02:56 PM
Review how to combine data. I suspect that's your first and probably biggest issue.
07-02-2017 03:38 PM
Beyond to @Reeza's comment, relating to combination of datasets,
you have an error defining a date literal. Change line into:
and you can calculate days between dates just by:
days = date - last_date;
no need to use special function.
07-03-2017 01:42 AM
proc print data=date_mtcars;
After defining date as you said, it's showing error again,
07-02-2017 03:33 PM
Assuming that date is actually a SAS date, your problem is likely that you defined:
when you should have used:
Art, CEO, AnalystFinder.com
Need further help from the community? Please ask a new question.