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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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