Learning SAS? Welcome to the exclusive online community for all SAS learners.

Problem importing Excel sheets into SAS U edition

Reply
Occasional Contributor
Posts: 13

Problem importing Excel sheets into SAS U edition

I have been trying to import XLS and XLSX files into SAS but facing some issues. I tried running this code. Experts, I would appreciate your advice. Thank you.

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 /** Import an XLS file. **/

44 

45 PROC IMPORT DATAFILE="/Users/sanketshah/Box Documents/Coursework/Summer 2014/Data Analysis/Barner/filetoimport.xlsx"

46 OUT=WORK.MYEXCEL

47 DBMS=XLSX

48 REPLACE;

49 RUN;

ERROR: The path /Users/sanketshah/Box Documents/Coursework/Summer 2014/Data Analysis/Barner/filetoimport.xlsx is invalid because it

  is not in the list of accessible paths when SAS is in the lockdown state.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE IMPORT used (Total process time):

  real time 0.05 seconds

  cpu time 0.03 seconds

  

50 

51 /** Print the results. **/

52 

53 PROC PRINT DATA=WORK.MYEXCEL; RUN;

ERROR: File WORK.MYEXCEL.DATA does not exist.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE PRINT used (Total process time):

  real time 0.07 seconds

  cpu time 0.01 seconds

  

54 ;

55 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

65 ;

Super User
Posts: 19,817

Re: Problem importing Excel sheets into SAS U edition

Posted in reply to sanketshah07

Have you first created a shared drive between the VM and your computer?

Occasional Contributor
Posts: 13

Re: Problem importing Excel sheets into SAS U edition

I don't think so. Can you tell me how to do that?

Contributor
Posts: 23

Re: Problem importing Excel sheets into SAS U edition

Posted in reply to sanketshah07

Hi Sanket,

I have only installed this using VirtualBox and the instructions that came with it were pretty clear. I have cut and paste them here for you:

Step 3: Create a folder for your data and results.

a. On your local computer (in a location that you will remember), create a folder called SASUniversityEdition and a subfolder called myfolders. You will save all of your SAS University Edition files to this location.

b. In VirtualBox, select the SAS University Edition vApp, and then select Machine > Settings.

c. In the navigation pane of the Settings dialog box, select Shared Folders, and then click .

d. In the Add Share dialog box, select Other as the folder path.

e. In the Browse for Folder window, open the SASUniversityEdition folder and select the myfolders subfolder. Click OK (or Choose, depending on your operating system).

f. In the Add Share dialog box, confirm that Read-only is not selected, and then select the Auto-mount and Make Permanent (if available) options. Click OK.

g. Click OK to close the Settings dialog box.

If you use VMware then the instructions are in Chapter 2 of the installation guide.

You then need to make sure your Excel workbook is in the shared folder so that you can see it in SAS Studio. Also, once you can see it use the Properties button (top of the left panel of windows in SAS Studio when you expand the Folders tab, you will see this button identified when you mouse over) to guide you regarding the syntax for the path that you need for the file.

New User
Posts: 1

Re: Problem importing Excel sheets into SAS U edition

Hi asmat,

I use Mac. After I created the shared folder, I have seen it on the left side of Sas studio. However, when I click on it, the box of download appear. Can you tell me how to open my file. :'( It is Excel file.

On the other hand, I also try to open it through Snippets, my code is

PROC IMPORT OUT=work.saspractice

        DATAFILE="/folders/myfolders/sasuser.v94/ggdgfgf.xlsx"

        DBMS=xls REPLACE;

    RANGE="addicts";

    GETNAMES=YES;

    MIXED=NO;

  

RUN;

But is didn't work Smiley Sad

Community Manager
Posts: 586

Re: Problem importing Excel sheets into SAS U edition

Posted in reply to zikzak_mino_yahoo_com_vn

Hi thank you for visiting this community. More community members will see your inquiry and have an opportunity to respond if you start a new discussion. Look in the "Actions" box in the right nav here and click "Start a discussion." Thanks again for being part of the Analytics U Community!

-
Bev Brown
Visit me on LinkedIn.
Twitter too: @BevBrown
Thank you for using SAS.jpg
Ask a Question
Discussion stats
  • 5 replies
  • 2296 views
  • 1 like
  • 5 in conversation