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"
Hi,
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.
Vishal Jeet
Peter Flom wrote:
>Hello again
>
>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.
>
>00614D
>08185C
>08394B
>08545A
>
>but later on, they are longer, e.g.,
>BW27011a
>BW28011a
>BW29011a
>BW31011a
>EN20101A
>EN20102A
>
>(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;
> GETNAMES=YES;
> DATAROW=2;
>RUN;
>
>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.
>
>Two questions:
>1) How can I fix this?
>2) Isn't this a horrible bug?
>
>Thanks in advance
>
>Peter
>
>PS I will also write to SAS tech support about this.
>
>Peter L. Flom, PhD
>Statistical Consultant
>www DOT peterflom DOT com
|