I'm new to SAS and am accumulating total clock time values together per customer. The input is already coming in a SAS TIME format. When I summarize all the times, I am getting an HHH:MMS result. I realize it would be easy to multiply the summary hours by 60 and add to the minutes but I also need to represent other entries that are not summarized.
So out of curiosity, is there a way to format summarized values in minutes? Or is there a way to converted stored, formatted times back to SAS times (stored in seconds from midnight)?
I understand that SAS TIME variables are numeric values representing seconds from midnight, but when I perform a proc print from the data I am summarizing (before I do anything with it), it is printing the times in TIME8. format without me coding a FORMAT on my print. How can I get the times back to the SAS (default) numeric value, or represent my total in minutes?
If PRINT displays the value using TIME8. format without you specifying the format, then the format has already been attached to the variable. Format assignments are usually inherited from earlier steps.
PROC CONTENTS will show the format assignments for the variables in your data set.
Formats do not alter what is stored only how the value is to be displayed.
It could be solved by this way, for example,
input time time10. ;
format time time10.;
create table r as
select ROUND(sum(time)/60) as r