Date: Wed, 18 Oct 2006 02:45:08 -0400
Reply-To: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject: Re: input data not consistent
Hi JJJ,
You should firstly question the origin of the inserted newline characters.
Is there some regular pattern? Then you could use the same pattern to remove
them using a dedicated algorithm.
I have developed a macro RemBugNL, that removes undesired, premature newline
characters in (text) fields in ascii data. But it only works correctly if
the line lengths of all records are or should be equal (fixed length
records). And it replaces the newlines by one space at least, sometimes by
two or three spaces.
See http://home.hccnet.nl/jim.groeneveld/software/SASmacro
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Tue, 17 Oct 2006 13:01:15 -0700, jjj912@yahoo.com <jjj912@YAHOO.COM> wrote:
>My input data is comma delimited and it normally looks like either
>N,X,"A",Y,"B"
>N,X,"A",Y,"B"
>
>However, sometimes it looks like
>N,X,"A
>",Y,"B"
>N,X,"A",Y,"B"
>
>The data for a single observation is on two lines sometimes. How would
>I go about telling SAS to look at the next line to see if the current
>observation spans two lines and, if so, to read the second line for the
>rest of the data?
|