Date: Wed, 28 Dec 2005 22:03:26 -0800
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: Can this be solved by INFILE and INPUT alone?
Content-Type: text/plain; format=flowed
dubro@DOLIC.DE wrote back:
>thank you for this idea. There is a reason why this (to my knowledge)
>can't work. I forgot to
>mention that the data eventually can be very long. That is the reason
>why I put the LRECL to
>maximum. The maximum value for automatic variable _INPUT_ is 32,767
>which is far less than I need.
>Maybe I should think about a workaround.
One work-around you might consider is throwing Perl at your infile. (I'm
readers are *shocked* that I suggest Perl. :-)
Here is some TOTALLY UNTESTED Perl code which might solve your problem.
It translates all '(' into a space and all ')' into a newline. This should
independent, up to the choice of the type of quotes.
perl -0777pe "tr/()/ \n/" YourFile > NewFile
If you are running this on a unix box, switch the double quotes to single
Perl will know what the 'right' newline is for your OS. Then the resulting
should be imminently readable by SAS, and you won't have the 'long line'
to fight with.
Of course, if you are having this trouble because you are on Windows and you
trying to read a unix file, then you may *see* the file as being all one
when in fact it actually has line breaks, probbly in between the close and
parens. If so, then you could fix this by the easy solution of including
option in your INFILE statement and not knocking yourself out with all the
If this doesn't work, then you'll have to go with Howard's solution, or
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Express yourself instantly with MSN Messenger! Download today - it's FREE!