Original data is &lib..&customersdetail
data original_data;
input var1$ CON_DATE_START PL_DATE_START SS_DATE_START;
datalines;
A 12/12/2008 11/01/2022 05/10/2007
B 19/01/2001 11/02/2008 01/03/2020
C 23/10/2008 02/08/2019 02/02/2010
D 01/09/2002 01/01/2000 19/03/2006;
run;
I want to replace the current CON_DATE_START, instead of that to use calculation CON_DATE_START = min(PL_DATE_START, SS_DATE_START)
Expecting to see:
var1 CON_DATE_START PL_DATE_START SS_DATE_START
A 05/10/2007 11/01/2022 05/10/2007
B 11/02/2008 11/02/2008 01/03/2020
C 02/02/2010 02/08/2019 02/02/2010
D 01/01/2000 01/01/2000 19/03/2006
Because the next step is in macro, I dont know how to link my replacement calculation of CON_DATE_START, so I dont need to change anything to below.
proc sort
data=&lib..&customersdetail
out=_&customersdetail;
where also ANLAGE eq "&anlage";
run;
%if %length(&anlage) %then _&customersdetail;
%else &lib..&customersdetail;
(rename=(DONOTBUY=_DONOTBUY)
where=(_DONOTBUY is missing))