I have a simple transpose from wide with 11 columns to tall with 3 columns. When the data is wide the numbers are formatted to show commas, when tall they lose the formatting. Is there anyway in the proc to format the columns?
I'm following up with a proc report, so if I can format there I'll be happy to do it there.
Add a format statement to Proc Report or override separately for each variable in the Define statement.
I suspect that all of the variables in the wide format did not have the same format.
I just did a quick test and when all the variables have the same format the result has that format but if they have mixed formats then the transposed end up with BEST format.
SAS variables have the format, not individual cell values like spreadsheets. So only one format can be applied. I suspect the SAS developers chose to use a BEST format when there is a conflict so something appears instead of the things that might happen trying to display a large currency value with a date format...
Add a format statement to Proc Report or override separately for each variable in the Define statement.
I suspect that all of the variables in the wide format did not have the same format.
I just did a quick test and when all the variables have the same format the result has that format but if they have mixed formats then the transposed end up with BEST format.
SAS variables have the format, not individual cell values like spreadsheets. So only one format can be applied. I suspect the SAS developers chose to use a BEST format when there is a conflict so something appears instead of the things that might happen trying to display a large currency value with a date format...
Spot on, I didn't realize I missed one of the (pre transpose) columns in formatting. Once I fixed that it's perfect, and the formatting held through the proc report.
Have a great weekend, Happy Holidays, stay healthy.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.