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 !

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 7 replies
  • 5478 views
  • 1 like
  • 3 in conversation