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 SAS
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;
How did you import the Excel file?
I used snippet procedure and then inputted the file location
First i uploaded the file to the sasuser v.94 and then i used the following code above to import it.
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:
First i uploaded the file to the sasuser v.94 and then i used the following code above to import it.
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;
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;
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.
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.