I recently ran into this problem attempting to use the ODS TAGSETS.EXCELXP in a PROC REPORT, the resulting output in .xml would open fine in Excel however the date fields would come through as TEXT even after applying the {TAGATTR='format:m/d/yyyy'} as a STYLE. My solution was two part; first create a new variable adding 21916 days to the original varialbe and secondly not applying a SAS format to the new variable. Now the PROC REPORT using ODS TAGSETS.EXCELXP results in an XML file that opens in Excel and the date fields are recognized by Excel as date and not as text.
Reference for the 21916 days came from this SUGI paper: http://www2.sas.com/proceedings/sugi29/068-29.pdf
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.
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.