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 2012, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 8 Mar 2012 09:39:53 -0600
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: reading in Excel where data for a single record is on two rows
Comments:   To: "Durrett, Cindy" <CindyDurrett@fdle.state.fl.us>
In-Reply-To:   <B39864771C6F074BB21AA235089174DD0209E8FED6@MBX1.myfdle.net>
Content-Type:   text/plain; charset=ISO-8859-1

I can't exactly tell what your data looks like since it seems to be on lots of rows but if you save it as a CSV, you can input two lines in one datarow.

data need; infile "whatever.csv" dlm=','; input stuff stuff stuff $ stuff $ / stuff stuff stuff stuff $ ; run;

Or something to that extent. Then everything will be in one row in SAS.

-Joe

On Thu, Mar 8, 2012 at 9:30 AM, Durrett, Cindy < CindyDurrett@fdle.state.fl.us> wrote:

> Hi. I have an Excel file that I need to read into SAS. Each "record" has > been put onto two rows. > > (NOTE: Data presented here is not real - it is made up to simulate the > actual data.) > > > > STATUTE > > DESCRIPTION > > CASE # > > ARR_DATE > > LASTNAME > > FIRSTNAME > > DOB > > OTBS > > 877.03 > > BREACH OF PEACE/DOC/FIGHTING/BRAWLING > > 56789078 > > 02/01/2012 > > STOOGE > > MOE > > 05/01/1964 > > 0654312345 > > 316.1935-2 > > BREACH OF PEACE/DOC/FIGHTING/BRAWLING > > 87670987 > > 02/01/2012 > > STOOGE > > LARRY > > 07/01/1956 > > 0654312975 > > 843.01 > > BREACH OF PEACE/DOC/FIGHTING/BRAWLING > > 67164987 > > 02/01/2012 > > STOOGE > > CURLY > > 01/01/1970 > > 0654312000 > > > > What I want is to have it read in so one row per record: STATUTE, > DESCRIPTION, CASE, ARR_DATE, LASTNAME, FIRSTNAME, DOB, OTBS. > > We don't have the ACCESS-PC component of SAS. > > Before I try a bazillion different ways to read this in, I thought I'd see > if anyone has an "oh yeah, I read data in like this all the time, here's > what you do" method to share :) Or if there is an Excel trick that I can > put it all onto the same Row in Excel - then I could handle that no worries. > > Thanks, > > Cindy D. >


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