I am trying to compute the difference in dates based on the date values in two columns and store the results in a third column. The dataset I have looks like this below. Id Col1_Date Col2_Date
1 2009-09-10 1916-02-29
1 2009-09-10 NA The expected output should be Id Col1_Date Col2_Date Date_Diff
1 2009-09-10 1916-02-29 93.6
1 2009-09-10 NA NA I have tried a simple DataSet as shown below, but this is not working. I am not seeing any values in Date_Diff column. DATA WORK.DF1 ;
SET WORK.DF1 ;
FORMAT DOB date10.;
Date_Diff = Col1_Date - Col2.Date;
RUN; Any help or suggestions on achieving this is much appreciated.
... View more