LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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


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