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

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;

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


1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

3 REPLIES 3
Ksharp
Super User

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

Cynthia_sas
SAS Super FREQ

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
cxkev
Fluorite | Level 6

Thank you both for your help.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 1606 views
  • 3 likes
  • 3 in conversation