May 21, 2010 #1 proximo20 Technical User Joined Sep 29, 2009 Messages 22 Location US Hi, My data looks like this time code 1300 ert 1412 brt 1435 grt and I need it like this 13:00 ert 14:12 brt or 1:00 ert 2:12 ... Thanks
Hi, My data looks like this time code 1300 ert 1412 brt 1435 grt and I need it like this 13:00 ert 14:12 brt or 1:00 ert 2:12 ... Thanks
May 23, 2010 #2 dblan MIS Joined Jul 6, 2007 Messages 58 Location US I'm not a time expert, but here is my best effort. Code: /*sample dataset*/ data unformatted; input time code $3.; datalines; 1300 ert 1412 brt 1435 grt ; run; data formatted; set unformatted; newtime = put(time,$4.); format realtime hhmm5.; realtime = hms(substr(newtime,1,2),substr(newtime,3,2),00); run; DBLAN Upvote 0 Downvote
I'm not a time expert, but here is my best effort. Code: /*sample dataset*/ data unformatted; input time code $3.; datalines; 1300 ert 1412 brt 1435 grt ; run; data formatted; set unformatted; newtime = put(time,$4.); format realtime hhmm5.; realtime = hms(substr(newtime,1,2),substr(newtime,3,2),00); run; DBLAN
May 23, 2010 Thread starter #3 proximo20 Technical User Joined Sep 29, 2009 Messages 22 Location US Thanks DBLAN, it works. Upvote 0 Downvote