Typically cupa_dt is greater than start_dt. However, when start_dt is greater than cupa_dt I need to switch around start_dt and cupa_dt to get the correct difference between the two dates. Is there any way to accomplish this without creating a flag (ie cc_check)? cupa_dt=dhms(TDT,0,0,TTM); start_dt=dhms(CSDAT,0,0,CSTIM); cc_check=0; if (start_dt>cupa_dt and cupa_dt ne .) then cc_check=1; if(cc_check=0) then do; cc_diff=round(((cupa_dt-start_dt)/86400),0.01); end; if(cc_check=1) then do; cc_diff=round(((start_dt-cupa_dt)/86400),0.01); end; Thank you.
... View more