03-20-2016 12:56 AM
* Using SAS Studio 9.2, I believe
Sometimes the simplest things throw you. As I review, I find I am having trouble importing an excel spreadsheet. I have written
PROC IMPORT DATAFILE="/home/teleous0/Cody/drugtest.xls" OUT=mtl.drugtest; DBMS=XLS; GETNAMES=drugtest; RUN;
I am receiving the following message:
ERROR: Output SAS data set must be provided.
No warnings but I have five notes (three of the notes are standard but the other two I don’t fully understand, given the statements I’ve written (see below)
NOTE: ODS PDF(WEB) printed no output. (This sometimes results from failing to place a RUN statement before the ODS PDF(WEB) CLOSE statement.) 70 FILENAME _GSFNAME; NOTE: Fileref _GSFNAME has been deassigned.
I have (1) copied and pasted the path directly from properties, (2) double checked to be sure the dbms is .xls, (3) used the same name and different six character names for the “out=statement, (4) added ‘replace’ as part of the out statement (5) added & deleted the ‘sheet=xyz’ statement (there is only one sheet) (6) responded to “get names with ‘Yes’, ‘No’ and deleting the statement all together and (7) I've tried it saving the data in both the work and the permanent library. I’ve been on line and nothing I’ve tried works; I still get the error message. Please help me.
NOTE: Using the SNIPPET didn’t work either.
03-20-2016 02:32 AM - edited 03-20-2016 02:34 AM
You have extra semicolons in your PROC IMPORT statments.
OUT, DBMS, REPLACE are all parts of PROC IMPORT, and must end up by only one semicolon.
PROC IMPORT DATAFILE="/home/teleous0/Cody/drugtest.xls" OUT=mtl.drugtest DBMS=XLS; GETNAMES=YES; RUN;
Also GETNAMES valid values only is YES or NO. Which specifies whether the IMPORT procedure generate SAS variable names from the data values in the first record in the input file or not.