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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 1098 views
  • 2 likes
  • 4 in conversation