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 2024

Innovate_SAS_Blue.png

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. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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