Hi all, I am brand new to DS2 and I wonder if you can give any suggestions on comparing dates. The logic is pretty straightforward. I convert the string to the date and then convert to the double for comparing purpose. Everything is fine till I change the hard coded '2018-06-04' with a variable 'date_String'. Then the date conversion step fails. Do I miss anything? Thanks very much! Here is my code: data _null_; method run(); dcl date dt1 dt2 dt3; dcl double ddt1 ddt2 ddt3 we; dcl varchar(10) date_String; date_String = '2018-06-04' Dt1 = date date_String; Dt2 = date '2018-06-05'; Dt3 = date '2019-01-04'; ddt1 = to_double(dt1); ddt2 = to_double(dt2); ddt3 = to_double(dt3); put ddt1= ddt2= ddt3=; if ddt1 < ddt3 AND ddt2 < ddt3 then we = 5.3; put we=; end; enddata; run;
... View more