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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.