BookmarkSubscribeRSS Feed
attjooo
Calcite | Level 5

I am using SAS Enterprise Guide 6.1.

I want to use PROC IMPORT to import the values from an Excel workbook with multiple worksheets. It's 32-bit Excel 2010.

DBMS = Excel doesn't work, but DBMS =xlsx does. although the documentation says that the first alternative should be right. The second alternative I have found somewhere on the Internet.

Any comments  about the documentation on PROC IMPORT for SAS?

The worksheet have values in somecells and fomulas, giving values in other cells. I only want the first category of values and the second category of values resulting from the formulas.

So if A1 = 14 and B1 = 6 and C1 = A1 / B1, where the value in C1 is formatted with 1 decimal, then I want to get the values 14, 6 and 2.3 imported. Not 14, 6 and 2.333......333.

Any help would be appreciated.

1 REPLY 1
RichardinOz
Quartz | Level 8

In your example 2.333......333 is the unformatted (underlying) value in Excel, which is what SAS reads and imports.  You can apply a SAS format such as 16.1 or comma20.1 after the import to achieve what you want.

The standard import procedure in SAS does not carry across the format applied in Excel, although in the case of dates SAS uses the Excel format to identify the value as a date, import it and adjust the base date and apply a SAS date format which might or might not look similar to the Excel format.

You might be able to achieve what you want by exporting the data as a text file (CSV or tab delimited) and importing that into SAS.

Richard

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!

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
  • 598 views
  • 4 likes
  • 2 in conversation