09-01-2015
KenB
Calcite | Level 5
Member since
07-15-2014
- 2 Posts
- 0 Likes Given
- 0 Solutions
- 2 Likes Received
-
Latest posts by KenB
Subject Views Posted 10771 07-18-2014 03:05 AM 10771 07-17-2014 08:42 PM -
Activity Feed for KenB
- Got a Like for Re: How to import excel file from a Mac to SAS studio? Please help. 08-28-2015 03:53 PM
- Got a Like for Re: How to import excel file from a Mac to SAS studio? Please help. 07-18-2014 10:51 AM
- Posted Re: How to import excel file from a Mac to SAS studio? Please help on SAS Programming. 07-18-2014 03:05 AM
- Posted Re: How to import excel file from a Mac to SAS studio? Please help on SAS Programming. 07-17-2014 08:42 PM
-
My Liked Posts
Subject Likes Posted 1 07-17-2014 08:42 PM 1 07-18-2014 03:05 AM
07-18-2014
03:05 AM
1 Like
Hi Dr, I can understand your frustration. You might try removing the RANGE keyword for the import as well (it names the worksheet in the file). On my Mac system, I can go to a 'Terminal' window and type/execute the following bolded command and I see 3 files in the folder listed. $ ls /SASUniversityEdition/myfolders/sasuser.v94/ HM1.sas Program 1.sas addicts.xls So I can see my Excel file of 'addicts.xls' plus other files. This is what I also see in the left pane of the SAS window under My Folders. I created the /SASUniversityEdition folder on the top level of my system (usually 'Macintosh HD') as well as the 'myfolders' folder underneath that. After doing that, the next time I signed into SAS, the 'sasuser.v94' folder was created for me. I would not believe that it would make much difference if I had created (but ownership of the folder might be different). Your /SASUniversityEdition folder may be under a different folder (such as your username on the Mac). Also make sure your shared folder setup allows FULL access (under Virtual Box Devices). As to the macro. This syntax works for me: %let path=/folders/myfolders/sasuser.v94 ; libname foo "&path" ; PROC IMPORT OUT= work.addicts DATAFILE= "&path./addicts.xls" DBMS=xls REPLACE; * RANGE="addicts"; GETNAMES=YES; MIXED=NO; * SCANTEXT=YES; * USEDATE=YES; * SCANTIME=YES; RUN;/** Import an XLS file. **/ 45 %let path=/folders/myfolders/sasuser.v94 ; 46 libname foo "&path" ; NOTE: Libref FOO was successfully assigned as follows: Engine: V9 Physical Name: /folders/myfolders/sasuser.v94 47 48 PROC IMPORT OUT= foo.addicts 49 DATAFILE= "&path/addicts.xls" 50 DBMS=xls REPLACE; 51 * RANGE="addicts"; 52 GETNAMES=YES; 53 54 MIXED=NO; 55 * SCANTEXT=YES; 56 * USEDATE=YES; 57 * SCANTIME=YES; 58 59 RUN; NOTE: The import data set has 238 observations and 6 variables. NOTE: FOO.ADDICTS data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.03 seconds cpu time 0.03 seconds
... View more
07-17-2014
08:42 PM
1 Like
My first time with this, I would get a 'spinning wheel' in a RUNNING window that indicated that something was occurring but nothing ever did. It finally works after restarting the VirtualBox SAS engine once the file path was set up. SAS appears to want the files in the MyFolders area. For me to set that up, I have under SASUniversityEdition a 'myfolders' folder /SASUniversityEdition/myfolders/ After starting the virtual box machine, SAS created a new folder 'sysuser.v94' /SASUniversityEdition/myfolders/sysuser.v94/ It is in this folder (on the Mac), I placed the Excel file. The PROC IMPORT looks like: PROC IMPORT OUT= work.addicts DATAFILE= "/folders/myfolders/sasuser.v94/addicts.xls" DBMS=xls REPLACE; RANGE="addicts"; GETNAMES=YES; MIXED=NO; * SCANTEXT=YES; * USEDATE=YES; * SCANTIME=YES; RUN;/** Import an XLS file. **/ This version of SAS does not like the keyword EXCEL. Use XLS. It would appear that you need to create the myfolder directory structure before starting the virtual machine. Refresh within SAS does not appear to work correctly. I don't believe that you are restricted to using the sub-folder sasuser.v94.
... View more