Hey, I am new to SAS university edition and I am trying to import data from an excel file into SAS. Here is my code below.
LIBNAME Present 'C:\Users\asant\Documents\datamanagement\Module1.xlsx';
data Present.Module1;
set Present.Module1 SHEET='SHEET1$'n end=;
keep Student_id, Week_no_1, Week_no_2, Week_no_3, Week_no_4, Week_no_5, Week_no_6, Week_no_7, Week_no_8, Week_no_9, Week_no_10, Week_no_11, Week_no_12;
label Student_id = 'Student ID'
Week_no_1 = 'Week no 1'
Week_no_2 = 'Week no 2'
Week_no_3 = 'Week no 3'
Week_no_4 = 'Week no 4'
Week_no_5 = 'Week no 5'
Week_no_6 = 'Week no 6'
Week_no_7 = 'Week no 7'
Week_no_8 = 'Week no 8'
Week_no_9 = 'Week no 9'
Week_no_10 = 'Week no 10'
Week_no_11 = 'Week no 11'
Week_no_12 = 'Week no 12';
run;
proc contents data=Module1;
run;
proc print data=Module1;
title Math attendance;
run;
libname Present clear ;
These are the errors that I'm getting. This is my log
The virtual machine in which University Edition runs can not access your desktop's drive as a whole, only the shared folder you defined when you set up the instance in Virtualbix or VMPlayer. If you followed the instructions, that shared folder is accessed within the UNIX operating system of the VM as
/folders/myfolders
Store your Excel file in the Windows location of the shared folder, and use the above path in your libname statement.
sheet=
is not a valid option in a SET statement; it is also not needed. In a library defined for an Excel file, the sheets appear as datasets.
Hi, thank you for your reply. I have done what you said. However, I am still getting these errors.
Hi @Becket
You need to specify the XLSX engine in your LIBNAME statement:
LIBNAME Present XLSX '<your path>\Module1.xlsx';
Best,
Hi, I have done that and that's gotten rid of one error, but the other errors still persist.
Thanks
Posting just the ERROR message without the statement that caused it is useless.
From your previous post, I guess that you still have not removed the syntactically invalid SHEET option.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.