BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aduragbemi
Calcite | Level 5

After uploading and importing my excel file, SAS says it contains no column. what does this mean and how can i rectify this. I have searched for possible solution but to no avail. It quite getting frustrating as i cant find a way to resolve this and am just starting to learn SASff6227d64d00d27631910a470a09ad5.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

You have code to create WORK.TUTOR from your XLSX file.  (What's with the slash after the end of the filename in the PROC IMPORT code?  Didn't that cause an error? An XLSX file is not a directory.)

 

But you don't have any code to create TUTOR.DATA, other than the last line of code which looks like it is starting to generate a data step to make that dataset, but you are missing the rest of the data step.  If you wanted to run a data step the read from WORK.TUTOR and wrote to TUTOR.DATA you would need to also add at least a SET statement and a RUN statement.  Note if you just use a single level name SAS will assume you mean the use the WORK library.

data tutor.data;
  set tutor;
run;

 

View solution in original post

7 REPLIES 7
Aduragbemi
Calcite | Level 5

I used snippet procedure and then inputted the file location

 

Aduragbemi
Calcite | Level 5

f8206598583518973298d172f0caa3b.jpg

 

First i uploaded the file to the sasuser v.94 and then i used the following code above to import it.

 

Reeza
Super User

Attach the excel file please. Your file likely has issues. 

Please post your code and log directly to the forum, pictures are hard to read and more work for you.

 


@Aduragbemi wrote:

f8206598583518973298d172f0caa3b.jpg

 

First i uploaded the file to the sasuser v.94 and then i used the following code above to import it.

 


 

Aduragbemi
Calcite | Level 5

The excel file is uploaded.

 

This was the code i used to to import the excel file

PROC IMPORT DATAFILE="/folders/myfolders/sasuser.v94/wheat.xlsx/"
OUT=WORK.Data
DBMS=XLSX
REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=WORK.data; RUN;

 After importing the excel file then i created a library called tutor with this code

 

libname tutor "/folders/myfolders/";

After that i wanted to save the excel file i named data into the library with this code and after running it it brought out a message saying: "The table "TUTOR.DATA" cannot be opened because it does not contain any columns."

 

libname tutor "/folders/myfolders/";
data tutor.data;

Tom
Super User Tom
Super User

You have code to create WORK.TUTOR from your XLSX file.  (What's with the slash after the end of the filename in the PROC IMPORT code?  Didn't that cause an error? An XLSX file is not a directory.)

 

But you don't have any code to create TUTOR.DATA, other than the last line of code which looks like it is starting to generate a data step to make that dataset, but you are missing the rest of the data step.  If you wanted to run a data step the read from WORK.TUTOR and wrote to TUTOR.DATA you would need to also add at least a SET statement and a RUN statement.  Note if you just use a single level name SAS will assume you mean the use the WORK library.

data tutor.data;
  set tutor;
run;

 

Aduragbemi
Calcite | Level 5
thanks so much. the issue has been resolved

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 2665 views
  • 3 likes
  • 4 in conversation