06-24-2015 12:05 PM
Post some test data (as a datastep). At a guess:
Step 1 - split the variable and convert to minutes (note the best coding method, but its to show the process):
do while (scan(variable,i,",") ne "");
if mins=100 then mins=60;
if mins=115 then mins=75;
new_time="12:00"t + mins;
06-24-2015 12:08 PM
Are you sure 100 should be 1:00 am? You go from 45 minutes to 100 minutes, logically 45 = 12:45am and 100 = 1:00am doesn't jive:
time = put(number*60,timeampm.);
06-24-2015 02:00 PM
Are you saying that your actual data values are HOUR:MINUTE, but w/o the colon?
0245 (the integer) <=> 02:45 (the time)??
If so, then pull out the hour, minute values, convert to seconds.
(but w/o any data, we're just guessing).
data want; set have;
minutes = mod(badtime,100);
hours = floor(badtime/100);
seconds = hours*3600 + minutes*60;
format seconds timeampm. ;
Need further help from the community? Please ask a new question.