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 open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.