Dear SAS experts I have a dataset containing coordinates for moving persons with a new latitude and longitude for every 10 seconds. The dataset also contains coordinates for their goal location. I would like to create a new column showing the time value when a person reaches the goal location (i.e. latitudeX and longitudeX match goal_latitude and goal_longitude, respectively). I consider the person to have arrived when he is within 0.0005 of goal coordinates. goal_latitude goal_longitude new_column time1 latitude1 longitude1 time2 latitude1 longitude1 ... person1 55.7236 12.4472 2023-08-03T19:55:18.000+02:00 55.7215 12.4422 2023-08-03T19:55:28.000+02:00 55.7215 12.4424 person2 55.7234 12.4418 2023-08-03T19:55:01.000+02:00 55.7225 12.4368 2023-08-03T19:55:08.000+02:00 55.7226 12.4368 person3 55.7256 12.4435 2023-08-03T19:55:37.000+02:00 55.7247 12.4389 2023-08-03T19:55:38.000+02:00 55.7247 12.4389 Can this be done in SAS Enterprise Guide? I have already tried with a very long CASE-statement: CASE WHEN (INPUT(t1.latitude1,8.))<(INPUT(t1.goal_latitude,8.) + 0.0005) AND (INPUT(t1.latitude1,8.))>((INPUT(t1.goal_longitude,8.) - 0.0005)) AND (INPUT(t1.longitude1,8.))<(INPUT(t1.goal_longitude,8.) + 0.0005) AND (INPUT(t1.longitude1,8.))>((INPUT(t1.longitude,8.) - 0.0005)) THEN (t1.time1) ... ELSE 0 END And I got this error message: "ERROR: Result of WHEN clause 2 is not the same data type as the preceding results." Thank you for your help! VictorK
... View more