BookmarkSubscribeRSS Feed
Malathi13
Obsidian | Level 7

Hi,

I have a dataset with time variable and the time is in minutes. I want the fraction of a minute to multiply with 60 to get seconds. Can anybody help me with this.

 

e.g. These are the minutes, 1.98 minutes and I want the output as 1:59 seconds

 

Response  output

1.98           1:59

4.75           4:45

5.68           5:41

6.93           6:56

7.45           7:27

5.96           5:57

3.67           3:40

 

 

thank you

M

2 REPLIES 2
stuart_snap
Fluorite | Level 6

I think the trick is converting the time to seconds first and then using a time format.  So 1.98 minutes would be 60*1.98=118.8 seconds or rounded to 119 seconds

PaigeMiller
Diamond | Level 26

And then apply the MMSS. format to make it appear as 1:59

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 797 views
  • 0 likes
  • 3 in conversation