BookmarkSubscribeRSS Feed
11205213
Fluorite | Level 6

Hey, 
I would like to convert seconds (as 1897 seconds) in a minutes format (not hours). 

 

Can you help me please ? 
Thank !! 

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20
data _null_;
   sec=1897;
   format sec mmss.;
   put sec;
run;
11205213
Fluorite | Level 6

I just want to create a new variable (column) which will convert one existing variable in seconds in minutes 

PeterClemmensen
Tourmaline | Level 20

In that case

 

data _null_;
   sec=1897;
   min=sec/60;
   put sec= min=;
run;
11205213
Fluorite | Level 6

But : 1789 seconds / 60 = 29.82 minutes which is not in a good format 

Kurt_Bremser
Super User

@11205213 wrote:

But : 1789 seconds / 60 = 29.82 minutes which is not in a good format 


If you want those .82 m displayed as seconds, use the mmss. format, as already advised.

11205213
Fluorite | Level 6

OK thank you very much !

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 4689 views
  • 1 like
  • 3 in conversation