The SAS Output Delivery System and reporting techniques

ods tagsets.excelxp proc report date9. column displays as text in excel

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

ods tagsets.excelxp proc report date9. column displays as text in excel

Good Morning,

I am outputting a dataset into excel using tagsets.excelxp.

There is a date column that is formatted as date9. in SAS.

I am using a proc report within the ods code to output the data.

In the excel output, the date is formatted as text.

Is there a way I can show this as date format in excel?

/**********************************************************************/

ods tagsets.ExcelXP file="c:\test.xls"

style=egdefault

options(sheet_interval='none' sheet_name='referrals');

proc report data=referrals_freq;

run;

ods tagsets.ExcelXP close;

/**********************************************************************/



Accepted Solutions
Solution
‎05-01-2014 04:41 PM
SAS Super FREQ
Posts: 8,745

Re: ods tagsets.excelxp proc report date9. column displays as text in excel

Hi, here are some examples. You might want to work with Tech Support, too. When I use SAS 9.4 and TAGSETS.EXCELXP, the date variable is numeric in Excel and respects the SAS format. Please refer to the code and output shown in the attached screen shots. If your version of SAS is 9.3 or 9.4 and you are not seeing the date format, then that is something that should be checked out.

cynthia


With_tagattr.pngwith_only_date9.png

View solution in original post


All Replies
Super User
Posts: 9,691

Re: ods tagsets.excelxp proc report date9. column displays as text in excel

Check  tagattr={}  style . or change that date column into Character date by date9. format.

Solution
‎05-01-2014 04:41 PM
SAS Super FREQ
Posts: 8,745

Re: ods tagsets.excelxp proc report date9. column displays as text in excel

Hi, here are some examples. You might want to work with Tech Support, too. When I use SAS 9.4 and TAGSETS.EXCELXP, the date variable is numeric in Excel and respects the SAS format. Please refer to the code and output shown in the attached screen shots. If your version of SAS is 9.3 or 9.4 and you are not seeing the date format, then that is something that should be checked out.

cynthia


With_tagattr.pngwith_only_date9.png
Contributor
Posts: 28

Re: ods tagsets.excelxp proc report date9. column displays as text in excel

Thank you both for your help.

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 662 views
  • 3 likes
  • 3 in conversation