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