02-01-2013 03:00 PM
I am using the following to reformat some data from 9999 to 163-KN9-999:
This gives me exactly what I need and the variables look great when I export to .csv. Problem is that I need to export to .xlsx and the format does not "stick." In the .xlsx file the formats go back to only a 4 digit rather than the desired 163-KH9-999.
Any thoughts on why this is or ideas on another method that will not cause problems?
02-01-2013 03:03 PM
In the log SAS tells you that exporting to Excel will not maintain formats.
You have two options:
1) create a new variable and recode the variable using a put statement and output that variable instead.
2) Output using another destination, principally, tagsets.excelxp that will maintain the format.