- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 09-30-2018 02:27 PM
(5351 views)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Divide by 60.
If you want to display seconds as minutes, use the mmss. format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data _null_;
sec=1897;
format sec mmss.;
put sec;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I just want to create a new variable (column) which will convert one existing variable in seconds in minutes
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In that case
data _null_;
sec=1897;
min=sec/60;
put sec= min=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
But : 1789 seconds / 60 = 29.82 minutes which is not in a good format
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
OK thank you very much !