DATA Step, Macro, Functions and more

ERROR: Output SAS data set must be provided.

Reply
Occasional Contributor
Posts: 7

ERROR: Output SAS data set must be provided.

* Using SAS Studio 9.2, I believe

THE CHALLENGE

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'VE TRIED 

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.

 

Thank you. 

NOTE: Using the SNIPPET didn’t work either.

Thanks

Super Contributor
Posts: 490

Re: ERROR: Output SAS data set must be provided.

[ Edited ]

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.

Try this:

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.

 

Ask a Question
Discussion stats
  • 1 reply
  • 427 views
  • 2 likes
  • 2 in conversation