Hi,
I am using the following to reformat some data from 9999 to 163-KN9-999:
proc format;
picture KH_Format
low-high='9-999'
(prefix='163-KH');
run;
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?
Thank!
G
You could try the
ODS TAGSETS.EXCELXP and PROC PRINT
Anca.
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.
I think you will need to create a character version of the variable and export it insead of the numeric.
put(x,KH_FORMAT.)
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.