Date: Thu, 8 Mar 2012 10:35:55 -0500
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject: Re: reading in Excel where data for a single record is on two rows
That didn't translate into a email very well so I have no way to tell which
values are the first or the second row.
Why not just export it as a csv file and read it with a data step.
data want ;
infile 'mydata.csv' dsd dlm=',' firstobs=2;
input statute description
/ case ...
;
run;
On Thu, 8 Mar 2012 10:30:16 -0500, 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.
|