I have been boing some experiments...
1)
The first 'solution' I can think of is this hack (not pretty)
[pre]
data time;
input seconds;
h=hour(seconds);
m=minute(seconds);
s=second(seconds);
test = cat(scan(put(seconds,hhmm6.0),1,':'),' hours ',m,' mins ',s,' secs');
put (_all_)(=/);
datalines;
3600
360000
360065
;
run;
[/pre]
2)
And I can't think of how to do it with a picture format. The Hour directive will only display 0-23.
[pre]
proc format;
picture intervalX
low-high = '%H hours %M mins %S secs' (datatype=time);
run;
data time;
input seconds;
put seconds intervalX.;
datalines;
3600
360000
360065
;
run;
[/pre]
3)
Finally the following example - Generate a dataset with your range of values and use this as an input for your format.
[pre]
data interval;
fmtname='interval';
do i= 1 to 360065;
start = i;
label= cat(scan(put(i,hhmm6.0),1,':'),' hours ',minute(i),' mins ',second(i),' secs');
output;
end;
run;
proc format cntlin=interval;
run;
data time;
input seconds;
put seconds interval.;
datalines;
3600
360000
360065
;
run;
[/pre]
And your right - Strange that SAS does not have a format for this - perhaps in 9.21 🙂