Discussion:
Please help, what is wrong with 'GuessingRows' statement?
(too old to reply)
Nancy
2009-08-17 21:08:45 UTC
Permalink
PROC IMPORT OUT= WORK.Spec2
DATAFILE= "J:\Hsee\Spec\SpecB.xls"
DBMS=EXCEL REPLACE;
SHEET="Specb$";
GETNAMES=YES;
guessingrows=260;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;

RUN;

I tried to import the excel data, however, I always get the following
error:

guessingrows=260;
------------
180
ERROR 180-322: Statement is not valid or it is used out of proper
order.

I tried to put this statment for several places, it did not work.
What is wrong ?

Thank you so much!
Abel DK
2009-08-18 09:59:11 UTC
Permalink
Hi,

try to replace EXCEL with XLS, this work for me:

so replace: DBMS=EXCEL REPLACE;
With: DBMS=XLS REPLACE;


Best regard,

ABEL DK
Nancy
2009-08-18 13:33:22 UTC
Permalink
Still can not solve the problem :( .
Hi,
so replace:            DBMS=EXCEL REPLACE;
With:                    DBMS=XLS REPLACE;
Best regard,
ABEL DK
Kevin Myers
2009-08-18 14:02:37 UTC
Permalink
What version of SAS are you running?

----- Original Message -----
From: "Nancy" <***@GMAIL.COM>
To: <SAS-***@LISTSERV.UGA.EDU>
Sent: Tuesday, August 18, 2009 08:33
Subject: Re: Please help, what is wrong with 'GuessingRows' statement?
Post by Nancy
Still can not solve the problem :( .
Post by Abel DK
Hi,
so replace: DBMS=EXCEL REPLACE;
With: DBMS=XLS REPLACE;
Best regard,
ABEL DK
Mary
2009-08-18 14:21:44 UTC
Permalink
It depends on the DBMS source as to which statements are valid; guesssingrows is
only valid for CVS/TAB and DLM, not for Excel (See the help on Proc Import- Data Source
statements, then inside the box for each group are the ones that you can use).

If you want to use guessingrows, I would recommend exporting the data as a tab-delimited
file, then import as a tab-delimited file.

-Mary

--- ***@GMAIL.COM wrote:

From: Nancy <***@GMAIL.COM>
To: SAS-***@LISTSERV.UGA.EDU
Subject: Please help, what is wrong with 'GuessingRows' statement?
Date: Mon, 17 Aug 2009 14:08:45 -0700

PROC IMPORT OUT= WORK.Spec2
DATAFILE= "J:\Hsee\Spec\SpecB.xls"
DBMS=EXCEL REPLACE;
SHEET="Specb$";
GETNAMES=YES;
guessingrows=260;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;

RUN;

I tried to import the excel data, however, I always get the following
error:

guessingrows=260;
------------
180
ERROR 180-322: Statement is not valid or it is used out of proper
order.

I tried to put this statment for several places, it did not work.
What is wrong ?

Thank you so much!
Arthur Tabachneck
2009-08-18 15:29:16 UTC
Permalink
Nancy,

Out of curiosity, have you tried both changing the DBMS=EXCEL to DBMS=XLS,
as well as commenting out the last three lines (i.e., commenting out or
deleting?:

SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;

Art
--------
Post by Nancy
PROC IMPORT OUT= WORK.Spec2
DATAFILE= "J:\Hsee\Spec\SpecB.xls"
DBMS=EXCEL REPLACE;
SHEET="Specb$";
GETNAMES=YES;
guessingrows=260;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
I tried to import the excel data, however, I always get the following
guessingrows=260;
------------
180
ERROR 180-322: Statement is not valid or it is used out of proper
order.
I tried to put this statment for several places, it did not work.
What is wrong ?
Thank you so much!
Arthur Tabachneck
2009-08-21 19:46:28 UTC
Permalink
Nancy,

You never let the list know whether you were able to solve your problem.

Regardless, I just remembered a post from data_null_ this past November
that offered a macro to get Windows to reset its built-on guessingrows
setting.

If interested, the macro can be found at:

http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0811b&L=sas-l&D=1&O=A&P=41923
or, in short form: http://xrl.us/bfa8qi

HTH,
Art
--------
Post by Nancy
PROC IMPORT OUT= WORK.Spec2
DATAFILE= "J:\Hsee\Spec\SpecB.xls"
DBMS=EXCEL REPLACE;
SHEET="Specb$";
GETNAMES=YES;
guessingrows=260;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
I tried to import the excel data, however, I always get the following
guessingrows=260;
------------
180
ERROR 180-322: Statement is not valid or it is used out of proper
order.
I tried to put this statment for several places, it did not work.
What is wrong ?
Thank you so much!
Loading...