BookmarkSubscribeRSS Feed
Asger
Fluorite | Level 6

Hi.

 

In my data file I have a variable containing time consumption (hours:minutes; not a time of day). It is saved in the "time"-format. Using the Summary Statistics Wizard in SAS Enterprise Guide I end up with integers and not the original format of time.

How can I change this so I end up with a summary statistics of time?

See attached file.

 

All the best,

Asger

3 REPLIES 3
andreas_lds
Jade | Level 19

The time-format in sas is always the number of seconds since midnight. Please post your data using a data-step with datalines statement, office-files aren't helpful to show data.

Asger
Fluorite | Level 6

 

Thank you for the response. My input is hours and minutes between to dates and times; it is not a time of day. So I don´t think the number of seconds since midnight can be used here.

This is the autogenerated code from Enterprise Guide:

 

PROC MEANS DATA=WORK.SORTTempTableSorted

FW=12

PRINTALLTYPES

CHARTYPE

QMETHOD=OS

MIN

MAX

N

Q1

MEDIAN

Q3 ;

VAR "Tid diff1"n;

RUN;

 

Was that what you were looking for Andreas?

Tom
Super User Tom
Super User

Means will not try to use formats in that simple display.  If you want to attach a format then write your statistics to a dataset and print that.

Then you can attach formats to the values.

data x ;
  input y time5. ;
  format y time5. ;
cards;
10:30
11:30
;
proc summary ;
 var y;
 output out=want mean=mean_y min=min_y max=max_y ;
run;
proc print data=want;
  var m:;
  format m: hhmm. ;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1271 views
  • 0 likes
  • 3 in conversation