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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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