Desktop productivity for business analysts and programmers

How to import an excel file in SEG----Confused

Reply
Senior User
Posts: 1

How to import an excel file in SEG----Confused

i have run below code by using Sas Enterprice Guide 5.1(32 Bit) and it's runs successfully but

proc import datafile= "C:/PARAMETERS/Deviate_Param.XLS"
out=WORK.param
dbms=XLS
replace;
sheet="Parameters";
getnames=Yes;
run;

 i have run same code in Sas Enterprice Guide 5.1(64 Bit) and log shows physical files doesn't exist..

 

after that i have changed(refer below code) the XLS to xls (upper case to lower case) and program runs successfully without error and warning.

 

proc import datafile= "C:/PARAMETERS/Deviate_Param.xls"
out=WORK.param
dbms=XLS
replace;
sheet="Parameters";
getnames=Yes;
run;

is there any rules are in sas enterprice guide?kindly anyone explain this ?????

 

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: How to import an excel file in SEG----Confused

What bit version is your Office software?  By exporting/importing your data using XLS your invoking the Office software to use the file, if that bit type doesn't match your SAS bit version then you will have problems.  I would recommend using one of the other options possibly even libname excel may work in this scenario if you have 9.4:

libname tmp excel "c:/paramters/deviate_param.xlsx";

data work.param;
  set tmp.parameters;
run;

libname tmp clear;

 Avoiding proprietary file formats such as Office is always an option, plain text CSV files can be read in by any system on any OS. 

Community Manager
Posts: 2,693

Re: How to import an excel file in SEG----Confused

Where is SAS installed in this case?  Are you running with local SAS (installed on Windows along with SAS Enterprise Guide), or are you connecting to a remote SAS session?  If the latter, then the Excel file might not be accessible from that session using the path you specified.

 

In this case, users often need to copy the Excel file to the remote SAS session in order to complete the import step.  Fortunately this is easy to do with a Copy Files task -- a custom task for EG 5.1 but built-in for EG 7.13 and later.

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 108 views
  • 0 likes
  • 3 in conversation