Help using Base SAS procedures

How can I Import files into SAS without these errors

Reply
N/A
Posts: 0

How can I Import files into SAS without these errors

Hi I got SAS liscence newely added to my PC,but am unable to import files into SAS environment.Please look at the following errors.

NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) 9.1 (TS1M3 DBCS3054)
Licensed to CITIBANK JAPAN LTD., Site 0050507012.
NOTE: This session is executing on the XP_PRO platform.



NOTE: (E9BX05) SAS 9.1.3 SP 4

NOTE: SAS initialization used:
real time 3.06 seconds
cpu time 0.81 seconds

1 libname mylib "C:\Documents and Settings\mg51921\Desktop\Maithili\Staff List 2010 05.xls";
ERROR: The product with which the engine EXCEL is associated is either not licensed for your system or the product
license has expired. Please contact your SAS installation representative.
ERROR: Error in the LIBNAME statement.
2 proc print data=mylib.'Sheet1$'n; run;
ERROR: Libname MYLIB is not assigned.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds




3 data sasuser.new;
4 set mylib.'List$'n;
ERROR: Libname MYLIB is not assigned.
5 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.NEW may be incomplete. When this step was stopped there were 0 observations and 0
variables.
WARNING: Data set SASUSER.NEW was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds


6
7
8 proc import datafile = "C:\Documents and Settings\mg51921\Desktop\Maithili\Staff List 2010 05.xls"
9 out = sales DBMS = excel2003;
ERROR: DBMS type EXCEL2003 not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

10 run;



Can anyone Please suggest me what should I do?

Thank you in advance.
Valued Guide
Posts: 2,177

Re: How can I Import files into SAS without these errors

Posted in reply to deleted_user
to check what you have licenced from SAS, run the code
proc setinit noalias; run;
For the statement you used you need proc setinit to report[pre]SAS/ACCESS Interface to PC Files[/pre] with a date in the future.
N/A
Posts: 0

Re: How can I Import files into SAS without these errors

Hello Peter,

Thank you for your help.I checked and Access was not installed for SAS on my PC.
But Can you tell me how my import procedure works properly.
Valued Guide
Posts: 2,177

Re: How can I Import files into SAS without these errors

Posted in reply to deleted_user
Maithili

as you say ...

> Thank you for your help.I checked and Access
> was not installed for SAS on my PC.
> But Can you tell me how my import procedure works
> properly.

sorry
I don't think it is as easy as it should be.
I avoid it.
Learn how a data step can help you read a csv file with code like :[pre]data first_attempts ;
length col1 - col20 $20 ;
infile 'your_csf file path and name' dsd lrecl=10000 /* dlm='09'x */ ;
input col1 - col20 ;
if cats( of col1-col20 ) = ' ' then delete ;
run ; [/pre]The default delimiter implied with the "dsd" option is a comma. If you created a tab-delimited txt file, then remove the /* and */ from around dlm='09'x.
Once you have confidence that you are reading the columns col1-col20 OK, then apply specific informats and formats for dates and money.
There are many to choose from the list in the on-line doc.
A shortcut for dates is the informat ANYDTDTE.
Percent8. is good for those columns with a trailing percent symbol.
Learn about these and others in the on-line doc and training.

good luck
peterC
SAS Super FREQ
Posts: 8,864

Re: How can I Import files into SAS without these errors

Posted in reply to deleted_user
Hi:
This ERROR message (the first one) explains the problem:

ERROR: The product with which the engine EXCEL is associated is either not licensed for your system or the product
license has expired. Please contact your SAS installation representative.
ERROR: Error in the LIBNAME statement.


You can only use the LIBNAME statement to point to and access an Excel file if you have SAS/ACCESS for PC File Formats installed. When you attempted to use the LIBNAME statement, SAS could not find the modules associated with SAS/ACCESS for PC File Formats and issued an ERROR message.

Either
1) your site has the license and the product needs to be installed -- check with your SAS Administrator to determine how/when the installation can be done
or
2) your site did not get a license for SAS/ACCESS for PC File Formats and you will have to use other techniques for reading your data. The most common method that people use when they do NOT have SAS/ACCESS for PC File Formats is to save the Excel file as a CSV file and then read the CSV file with PROC IMPORT.

cynthia
N/A
Posts: 0

Re: How can I Import files into SAS without these errors

Posted in reply to Cynthia_sas
Hi Cynthia,

Thank you for Responding.I tried even converting the excel file into CSV and txt also but even I am unable to import or export and getting the errors same as for excel.

My SAS liscence includes Base Product,SAS/Graph and SAS/Connect.
Ignore my error No 1 and please look at the error No 3.I had MS office 2003 installed on my PC.I tried giving DBMS as excel2003,excel2000 and excel and for CSV files DBMS as CSV but I am not successful.My SAS version is 9.1.Earlier I worked on the same version and I never faced this problem.I do not have Remote server connection.So I have to run my codes on local PC by importing external files.So,Please let me know if there is any solution ASAP.
I was trying Infile statement,but I do not prefer it because I have to work at a time with 10-20 files which are in different formats and some times data is messy.It is not possible for me to check every file.

Thank you in advance.
SAS Super FREQ
Posts: 8,864

Re: How can I Import files into SAS without these errors

Posted in reply to deleted_user
Hi:
With BASE SAS, you will not be able to use the LIBNAME Excel engine, but you should be able to read a CSV file with this syntax:
[pre]
PROC IMPORT OUT= WORK.???
DATAFILE= "??????.csv"
DBMS=CSV REPLACE;
RUN;

proc print data=work.???;
run;
[/pre]

If you do have SAS/Access for PC File Formats, then, depending on your version of SAS, you should be able to use either of these models:

[pre]

PROC IMPORT OUT= WORK.???
DATAFILE= "??????.xls"
DBMS=EXCEL REPLACE;
SHEET="???";
RUN;

proc print data=work.???;
run;

** OR;

libname myxls excel '??????????';

data work.???;
set myxls.?????;
run;

proc print data=work.???;
run;
[/pre]

This paper has some good LIBNAME engine examples:
http://www2.sas.com/proceedings/sugi31/024-31.pdf

and the documentation has some good background info:
http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#/documentation/cdl...

cynthia
Ask a Question
Discussion stats
  • 6 replies
  • 994 views
  • 0 likes
  • 3 in conversation