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 (March 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 27 Mar 2011 14:44:45 -0400
Reply-To:   Peter Flom <peterflomconsulting@MINDSPRING.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Peter Flom <peterflomconsulting@MINDSPRING.COM>
Subject:   Re: Reading numeric data from a CSV file as if it was categorical
Comments:   To: Arthur Tabachneck <art297@ROGERS.COM>
In-Reply-To:   <201103271828.p2RApPoE016731@waikiki.cc.uga.edu>
Content-Type:   text/plain; charset="us-ascii"

Art

Thanks!

Guessing rows won't do it, because I don't know what row. I will look into mixed = and that macro

Peter

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Arthur Tabachneck Sent: Sunday, March 27, 2011 2:29 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Reading numeric data from a CSV file as if it was categorical

Peter,

Will the combination of setting guessingrows and mixed=yes work?

If not, you can find a macro at: http://www.nesug.org/proceedings/nesug03/ps/ps019.pdf

HTH, Art ------- On Sun, 27 Mar 2011 14:13:39 -0400, Peter Flom <peterflomconsulting@MINDSPRING.COM> wrote:

>Hello > > > >I have to read in data from 17 large (each is many megabytes) csv files. >They have some columns where the data is really categorical, but where >the vast majority uses numerical codes, but somewhere (hundreds of >lines in) there is text data. > > > >Of course, this makes SAS complain > > > >Ordinarily, I'd fix all this up in Excel. But with so many large files that >would be a major PITA. So, how can I tell SAS that some columns should >be categorical > > > >I wrote a mini-macro to read in the files: > > > >%macro imp(filename); > >PROC IMPORT OUT= WORK.&filename > > DATAFILE= "C:\personal\Consults\Olivia Dixon\&filename..csv" > > DBMS=CSV REPLACE; > > GETNAMES=YES; > > DATAROW=2; > >RUN; > >%mend imp; > > > >%imp(file1); > > > > > >And I then use it on 17 files. > > > >TIA as always > > > >Peter Flom > >Peter Flom Consulting > >http://www.statisticalanalysisconsulting.com/ > >http://www.IAmLearningDisabled.com


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