10-02-2014 10:04 AM
Hi, I have a SAS dataset with three columns corresponding to YEAR, MONTH, and DAY. I want to create a new column that is the total length in days (i.e., DAY + 30*MONTH + 365*YEAR). How can I do this? Thanks!sum
10-02-2014 10:38 AM
I wouldn't use a calculation like that as you may miss leap years. What is your duration here, you only provide one date, so what is the length in days *since*.
10-02-2014 10:57 AM
Another problem I am running into is that my data uses the values 97, 98, 99 to indicate things like "did not provide." For the purposes of this calculation, I want to set these all to zero. I tried using the DO OVER command, but I'm not sure why it's creating an empty data set.
10-02-2014 11:37 AM
Assuming the dataset name is set1 and the formula you want to use is ( DAY + 30*MONTH + 365*YEAR). Following code should work.
Create table Set2 as
SUM(DAY, (30*MONTH),(365*YEAR)) as TOTAL_DAYS