Hi Mike, The following will create a variable X1 which contains an augmented version of the X variable with the seconds converted to 0 - which is what the 4th argument in the DHMS statement represents. You can then compare the Y and X1 variables. DATA WANT; MATCH = 0; X="22MAY13:10:44:15"DT; Y="22MAY13:10:44:00"DT; X1=DHMS(DATEPART(X),HOUR(X),MINUTE(X),0); IF Y = X1 THEN MATCH = 1; FORMAT X X1 Y DATETIME18.; RUN; Of course you could also do the following, which negates the need for the additional variable.: DATA WANT; MATCH = 0; X="22MAY13:10:44:15"DT; Y="22MAY13:10:44:00"DT; IF Y = DHMS(DATEPART(X),HOUR(X),MINUTE(X),0) THEN MATCH = 1; FORMAT X Y DATETIME18.; RUN; Regards, Scott Edit: Removed Timepart references as they are not necessary.
... View more