Hi _ALL_
This is vicky i am having difficulty in finding latest TIME point from same DATE from below data , some one help me.
DATE | TIME | DEPTH |
10/7/2013 | 10:25:41 | 4781.35 |
10/9/2013 | 16:45:29 | 0 |
10/9/2013 | 17:28:31 | 0 |
10/13/2013 | 8:54:22 | 75.18197 |
10/13/2013 | 14:03:27 | 87.27948 |
10/13/2013 | 20:46:52 | 115.8728 |
10/14/2013 | 3:18:32 | 135.7762 |
10/14/2013 | 7:38:21 | 153.6802 |
10/14/2013 | 14:44:03 | 181.4292 |
10/14/2013 | 18:57:05 | 209.2909 |
10/15/2013 | 1:13:23 | 237.2716 |
10/15/2013 | 5:26:44 | 265.3894 |
10/15/2013 | 7:57:18 | 274.509 |
10/15/2013 | 12:29:55 | 303.2821 |
10/15/2013 | 16:57:01 | 331.976 |
10/14/2013 | 20:02:00 | 109.1032 |
10/16/2013 | 5:17:51 | 385.9804 |
10/16/2013 | 5:58:19 | 397.7579 |
10/16/2013 | 2:10:00 | 360.8314 |
10/26/2013 | 16:42:01 | 390.7048 |
10/26/2013 | 21:57:56 | 419.0634 |
10/27/2013 | 2:21:01 | 447.8823 |
10/27/2013 | 7:38:20 | 476.3902 |
10/27/2013 | 12:48:38 | 504.8128 |
10/27/2013 | 17:31:18 | 532.0619 |
10/27/2013 | 22:11:26 | 560.8838 |
10/28/2013 | 3:59:01 | 588.7486 |
10/28/2013 | 10:34:02 | 616.647 |
10/28/2013 | 18:17:32 | 643.2316 |
Here is a possible SQL solution:
PROC SQL;
CREATE TABLE WANT AS
SELECT * FROM HAVE
GROUP BY DATE
HAVING TIME=MAX(TIME)
;
QUIT;
Haikuo
Here is a possible SQL solution:
PROC SQL;
CREATE TABLE WANT AS
SELECT * FROM HAVE
GROUP BY DATE
HAVING TIME=MAX(TIME)
;
QUIT;
Haikuo
HI Haikuo
THANKS FOR YOUR REPLY ITS WORKING.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.