LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 13 Sep 2004 08:42:29 -0700
Reply-To:     kurts@field.com
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Kurt Schutzmann <kurts@FIELD.COM>
Subject:      Re: About Import Procedure, ASK FOR HELP!!!
Comments: To: "Rex.Lv" <rex.lv@126.com>
In-Reply-To:  <000801c49888$a3d5f9a0$0a00020a@rex>
Content-Type: text/plain; charset="iso-8859-1"

filename infile "c:\myfile" recfm=v lrecl=10000; %* assuming file is on a PC;

proc import out=sasfile data=infile dbms=csv; guessingrows=100; %* this option may not be available in v8. Run it to find out; run;

-----Original Message----- From: Rex.Lv [mailto:rex.lv@126.com] Sent: Saturday, September 11, 2004 10:23 PM To: kurts@field.com Subject: Re: About Import Procedure, ASK FOR HELP!!!

It doesn't work. Could you give me an example SAS code? I use SAS 8.2. Thx.!

Best Regards, Rex ----- Original Message ----- From: "Kurt Schutzmann" <kurts@field.com> To: "Myra Oltsik" <my_sas_spot@YAHOO.COM>; <SAS-L@LISTSERV.UGA.EDU>; <KUMARA@ESSILOR.COM.SG>; <rex.lv@126.COM> Sent: Saturday, September 11, 2004 3:05 AM Subject: RE: About Import Procedure, ASK FOR HELP!!!

> If you have a CSV or DLM file, then GUESSINGROWS= can be helpful. > > For excel files, try specifying the exact range (RANGE=) or the entire > spreadsheet. > > There is even one for access to specify the size of memo fields (MEMOSIZE=). > > Regards, > Kurt > > -----Original Message----- > From: Kurt Schutzmann [mailto:kurts@field.com] > Sent: Friday, September 10, 2004 11:39 AM > To: Myra Oltsik; SAS-L@LISTSERV.UGA.EDU; KUMAR Arun > [KUMARA@ESSILOR.COM.SG]; Rex.Lv [rex.lv@126.COM] > Subject: RE: About Import Procedure, ASK FOR HELP!!! > > > Better option: use the GUESSINGROWS option when reading in the file. > > Kurt > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Myra > Oltsik > Sent: Friday, September 10, 2004 8:04 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: About Import Procedure, ASK FOR HELP!!! > > > Rex, > > I've had the same experience. When SAS reads in an Excel file it gets > the length and format from the first "few" records it reads. I don't > know how many records it reads before it decides on the attributes, > however. If you put at least one of your longest records near the top > of your data you should get an appropriate length. If you don't care > what order the data are read in -- if you have an "ID" variable on > which you can sort -- then rearranging the records won't matter. If > the order you read in the records is important, then create a new > column with the row numbers on which you can sort the data later, and > then manually rearrange your records so SAS gets the right attributes. > > I hope this helps. > > Myra > > KUMARA@ESSILOR.COM.SG (KUMAR Arun) wrote in message > news:<07123CDF07D82249A6A840A789BC2EEEDDA5CB@sges0004.essilor.com.sg>... > > Hi Rex, > > I remember facing the same type of problems. Perhaps SAS decide the length > > of columns based on few observations(I don't remember exactly perhaps 20). > > So one way out is go to the sas log, copy the relevant proc import codes > and > > change the length according to your need for the columns. > > > > Regards, > > Arun Kumar > > > > -----Original Message----- > > From: Rex.Lv [mailto:rex.lv@126.COM] > > Sent: Friday, September 10, 2004 3:04 PM > > To: SAS-L@LISTSERV.UGA.EDU > > Subject: About Import Procedure, ASK FOR HELP!!! > > > > > > Hi, > > > > > > I want to import some data from excel files, but I'm lost. The columns > that > > have over 25 characters are automatically truncated to 25 character. > Anybody > > could give me a hand? Thx. a lot! > > > > > > The code that I used to import data is as followed: > > > > PROC IMPORT OUT= WORK.t > > DATAFILE= "C:\datafile.xls" /*The excel file includes the > > data*/ > > DBMS=EXCEL2000 REPLACE; > > RANGE="Sheet1$"; /*The sheet I want to import*/ > > GETNAMES=YES; > > RUN; > > > > > > Best Regards, > > Rex > > >


Back to: Top of message | Previous page | Main SAS-L page