BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Steelers_In_DC
Barite | Level 11

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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...

View solution in original post

2 REPLIES 2
ballardw
Super User

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...

Steelers_In_DC
Barite | Level 11

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. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 842 views
  • 1 like
  • 2 in conversation