The SAS Output Delivery System and reporting techniques

how to export time to excel with mm:ss format

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 102
Accepted Solution

how to export time to excel with mm:ss format

Hi SAS helpers,

 

I need to output some data storing in SAS as seconds to excel file by using ODS excel  proc report.

If the data in sas are numbers and when I output to excel, I need the data format like MMSmiley FrustratedS.

 

 my SAS data   output to excel

22                          0:22 or 00:22

35                          0:35 or 00:35

216                        3:36 or 03:36

21                          0:21 or 00:21

 

How do I format the data?

I used

proc report data=outtable nowd;

column ("time" meant stdt);

define meant/center display "Mean of Time" format=time. (or time8.);

define stdt/center display "SD of Time" format=time. (or time8.);

run;

Then I got the excel output results like:

 

my SAS data   output to excel

22                        00 :00:22 

35                          00:00:35 

216                        00:03:36 

21                          00:00:21 

 

But that is not what I want. Could anybody help me out? Thanks for any suggestion.

 

 

 


Accepted Solutions
Highlighted
Solution
‎02-09-2018 02:29 PM
Frequent Contributor
Posts: 102

Re: how to export time to excel with mm:ss format

Hello, I already solved that problem by using format=mmss. instead of format=time8..

Thank you for the reply, Reeza

View solution in original post


All Replies
Super User
Posts: 23,224

Re: how to export time to excel with mm:ss format

Look up TAGATTR to see how to set the time in the Excel format required.

 


daisy6 wrote:

Hi SAS helpers,

 

I need to output some data storing in SAS as seconds to excel file by using ODS excel  proc report.

If the data in sas are numbers and when I output to excel, I need the data format like MMSmiley FrustratedS.

 

 my SAS data   output to excel

22                          0:22 or 00:22

35                          0:35 or 00:35

216                        3:36 or 03:36

21                          0:21 or 00:21

 

How do I format the data?

I used

proc report data=outtable nowd;

column ("time" meant stdt);

define meant/center display "Mean of Time" format=time. (or time8.);

define stdt/center display "SD of Time" format=time. (or time8.);

run;

Then I got the excel output results like:

 

my SAS data   output to excel

22                        00 :00:22 

35                          00:00:35 

216                        00:03:36 

21                          00:00:21 

 

But that is not what I want. Could anybody help me out? Thanks for any suggestion.

 

 

 


 

Highlighted
Solution
‎02-09-2018 02:29 PM
Frequent Contributor
Posts: 102

Re: how to export time to excel with mm:ss format

Hello, I already solved that problem by using format=mmss. instead of format=time8..

Thank you for the reply, Reeza

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 216 views
  • 0 likes
  • 2 in conversation