BookmarkSubscribeRSS Feed
TL8
Calcite | Level 5 TL8
Calcite | Level 5

When using Proc Import to read an Excel file into SAS, the data doesn't seem to retain the format for a text, such as font, font size, bold, italic, etc. Wonder if there is a way to get over it, since the text field we're handling has complex format and it's hard to maninuplate in SAS.

3 REPLIES 3
Reeza
Super User

You're bringing data into SAS and you want to bring the bold/italic/font size over as well?

 

I don't think that's doable, at least not easily, but what are you calling complex and what would you expect to see? Post a sample Excel file and what you would expect to see in SAS.

 

It sounds like you might be storing data in your formats/fonts which is a bad way to store data. 

Kurt_Bremser
Super User

DATA is DATA. SAS has the capability of assigning formats for display, but that stays within the realm of pure text, so no fonts, color, bold/italic etc.

You can get colors and other atttributes in reports with PROC REPORT and advanced use of the ODS.

FreelanceReinh
Jade | Level 19

Maybe the intention is to replicate the styles found in the Excel sheet when writing the processed data with SAS to a suitable ODS destination.

 

More than 10 years ago I managed to read the text color from Excel sheets via DDE, but that was very complicated (to figure out). I could imagine that, depending on the file format (especially xlsx), more recent techniques would facilitate access to Excel's formatting information, but I'm not sure. PROC IMPORT is definitely inappropriate for this task.

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1416 views
  • 2 likes
  • 4 in conversation