user2234552
user2234552

Reputation: 55

Converting Excel file into SAS Dataset

I'm trying to import a dataset into SAS enterprise guide, however am having trouble 'converting' my excel file into a new SAS dataset file. Any easy way to do this? Like this:

libname LIBRARYNAME 'filesource...'
data Project2
set exdata.Project;
<math>
run;

But the file I have the data in is a Excel file... and it can't find it

Upvotes: 1

Views: 3431

Answers (2)

Joe
Joe

Reputation: 63424

In Enterprise Guide, you can create an import step. This is preferable for EG projects that will always be in EG, as it is OS-agnostic, server-agnostic, and version-agnostic, and leaves a single step on the process flow that you can move around where you need it to be run.

Choose (File menu) -> (Import Data), and then it will guide you through importing the file. When it completes, this will leave on your process flow an Import Data step that you can link to other programs (if you're using this program repeatably).

During that wizard, you will tell it what dataset name you want it saved as, and that will then exist as a SAS dataset in your project (usually in the work library unless you specify otherwise).

Upvotes: 0

Reeza
Reeza

Reputation: 21274

You are close, if you have to ability to access local files something like this may work. You may need to play around with the sheet name. Open the library once it's assigned to see how SAS refers to the sheets.

Libname mylib XLSX 'path to XLSX file';

Data want; 
    Set mylib.sheet_name;
Run;

Libname mylib;

Otherwise if your using EG on a server and your excel file is local you can import using the GUI tool.

Upvotes: 0

Related Questions