BookmarkSubscribeRSS Feed
Fluorite | Level 6


I am trying to do an excel formatting using SAS ODS, but this one has put me confused. 


SAS Dateset from:


ColA ColB ColC ColD ColE ColF ColG ColH ColI ColJ
Part1 Part1 Part1 Part1 Part2 Part2 Part2 Part3 Part3 Part3


Required output in excel:

Part1 Part2 Part3
colA colB colC colD colE colF colG colH colI colJ

Can someone provide suggestion on how this can be done? I do not need the complete code though, any suggestions on specific method or keywords to be used would be very helpful.


Thanks in advance.

Super User

Are you talking about spanning headers (not actually shown, the forum window may have seriously reformatted what you attempted to paste) where the "Part1" would be over ColA, ColB and Colc


|                 Part1           |
| Col A      |  ColB  |   ColC    |

Since I have to assume that ColA, ColB etc are variables in SAS are they all of the same type? All numeric or All character?


I suggest that you fill in your example with a bit more detail, such as do you have more than two rows in the data set now?


Best would be a short data step creating actual values that behave like your data (assuming what you actually have should not be shared).

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 2 in conversation