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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1630 views
  • 0 likes
  • 2 in conversation