Date: Thu, 25 Sep 2003 16:36:13 -0400
Reply-To: Francis Harvey <HARVEYF1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Francis Harvey <HARVEYF1@WESTAT.COM>
Subject: SAS and line breaks
I recently had an interesting file put before a program I wrote for
automatic processing that left me wondering what the best approach to
handling it is. This document was apparently written on a MAC as it
has lines that are broken only by carriage returns (CR) and then
reformatted on a PC with normal line breaks of carriage returns (CR)
followed by a line feed (LF).
When reading this file using SAS on a PC (which is where the
processing program runs), I initially PAD the source file to 100
characters (no line can be longer than that) and then load the data.
However, I am finding that SAS is not treating the CR without an LF as
a line break. My first inclination is to force the user to clean the
file to remove the problem before using my program, but I may be
overreacting. Another interesting point is that our Linux server may
become more widely used in the future or we may obtain UNIX generated
documents to reprocess which could cause there to be lines with an LF
without a matching CR.
So, would you force SAS to deal directly with such files, and if so,
how would you alter the data step to get them to process properly? I
am just going to assume that I will never see a file that has been
processed on both a MAC and a UNIX box as that would just seem to be
something I would have to talk to the individual about.
Francis R. Harvey III
WB 303, x3952
VB programmers know the wisdom of Nothing