Date: Wed, 27 Sep 2006 22:43:33 GMT
Reply-To: Paula Sims <me@HERE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paula Sims <me@HERE.COM>
Organization: SBC http://yahoo.sbc.com
Subject: Re: Reading in raw files and concatenating text
Content-Type: text/plain; charset="iso-8859-15"
Thank you all for the wonderful responses. I learned a great deal and in
the end used Manuel's version. However, I am intrigued about the issue
of the view and will explore this further for other applications.
You are all WONDERFUL!
Paula
In article
<092720061451.5120.451A8FEB0007684600001400220076106405029A06CE9907
@comcast.net>, iw1junk@COMCAST.NET says...
> Summary: Use View to handle BY processing of sorted external data
> #iw-value=2
>
> Paula,
>
> Nothing wrong with some of the answers you already have, but the
> opportunity is too good to not point out the advantage of a view.
>
> First create data.
> filename q temp ;
> data _null_ ;
> input ;
> file q ;
> put _infile_ ;
> cards4;
> 1234;1; ; ; ; ; ;Four score and seven years ago our fathers brought;
> 1234;2; ; ; ; ; ;forth on this continent, a new nation, conceived in
> 1234;3; ; ; ; ; ;Liberty, and dedicated to the proposition that all;
> 1234;4; ; ; ; ; ;men are created equal;
> 2345;1; ; ; ; ; ;To be or not to be;
> 3456;1; ; ; ; ; ;When in the course of human events it becomes;
> 3456;2; ; ; ; ; ;necessary for one people to dissolve the political;
> ;;;;
>
> Now we have a file as you describe. Make the view (no data pass).
>
> data v (drop=skip)/ view=v ;
> infile q dsd dlm=";" ;
> input id $ seq skip $ skip $ skip $ skip $ skip $ ln :$80.
> ;
> run ;
>
> Use the view with standard SAS tools.
>
> data w ( drop = seq ln ) ;
> length line $ 1000 ;
> do until ( last.id ) ;
> set v ;
> by id seq ;
> line = trim(line) || " " || ln ;
> end ;
> run ;
>
> I would use CATX function in version 9 to combine the lines, but
> I am working at a computer with only 8.2.
>
> Ian Whitlock
> ==============
> Date: Wed, 27 Sep 2006 00:40:20 GMT
> Reply-To: Paula Sims <me@HERE.COM>
|