BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
daisy6
Quartz | Level 8

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 MM:SS.

 

 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.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
daisy6
Quartz | Level 8

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

2 REPLIES 2
Reeza
Super User

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 MM:SS.

 

 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.

 

 

 


 

daisy6
Quartz | Level 8

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

Thank you for the reply, Reeza

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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