Comparing Durations and SAS Date Values
You can use SAS date values to
find the units of time between dates. Tradewinds Travel was founded
on February 8, 1982. On November 23, 1999, you decide to find out
how old Tradewinds Travel is, and you write the following program:
options yearcutoff=1920; /* Calculating a duration in days */ data ttage; Start = '08feb82'd;RightNow = today();
Age = RightNow - Start
; format Start RightNow date9.; run; proc print data=ttage; title 'Age of Tradewinds Travel'; run;
The following output
displays the results:
Display 15.12 Calculating a Duration in Days
The value of Age is 11404, a number that looks like an ...
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.