Date: Wed, 9 Jul 2008 16:08:44 GMT
Reply-To: vishal_jeet <u44742@UWE.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: vishal_jeet <u44742@UWE.UGA.EDU>
Subject: Re: Problem with importing from a csv file
Content-Type: text/plain; charset="utf-8"
You yourself created this problem by specifying datarow=2 option, with this
options proc import scan only first two data rows and assign the informats ,
else the defaultt value is 20. It would be rectified if you specify this
option up to a good extent where the largest length is met or simply equal to
number of record.
Peter Flom wrote:
>I have a .csv file with two columns, named CORE and CLUSTER. Core is a character field, cluster is numeric. The first few lines of CORE are 6 characters long e.g.
>but later on, they are longer, e.g.,
>(Yes, I know, that's a terrible way to write a variable, but it was due to it being input over a period of 25 years or so, from machines that required certain formats, which differed over time....)
>I am importing it into SAS using
>PROC IMPORT OUT= WORK.twoclust
> DATAFILE= "C:\Fivelead\Data\twoclust.csv"
> DBMS=CSV REPLACE;
>and this is creating two variable, appropriately CORE and CLUSTER, but CORE is formatted as $6. This causes major problems, because the first 6 characters of CORE are not unique.
>1) How can I fix this?
>2) Isn't this a horrible bug?
>Thanks in advance
>PS I will also write to SAS tech support about this.
>Peter L. Flom, PhD
>www DOT peterflom DOT com