Date: Tue, 29 Apr 2003 16:30:35 +0000
Reply-To: Peter Crawford <peter.crawford@DB.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@DB.COM>
Subject: Re: A strange problem.
Content-Type: text/plain; charset="us-ascii"
I don't think Ron's "pad" option will help, because the CR
of CRLF is being treated as data on unix. Pad will add
trailing blanks to that line, which won't make that CR
problem go away.
Adding CR to the defimiter set should solve the issue
If no delimiter is already defined, adding CR requires only in
infile ........ dlm='200D'x .........;
If it is a comma delimiter, then dlm='2C0D'x
If the data is being read by proc import, then catching the generated code
provides a "code base" in which to modify the infile statement
(as well as other things like var lengths, types and informats)
By the way, does anyone else think SI should at least fix their
generated code so that it doesn't give a bad example !
Copied from the generated code
if _ERROR_ then call symput('_EFIERR_',1); /* set ERROR detection macro variable */
generates the too familiar.. bad example "converted" messages in the log
NOTE: Numeric values have been converted to character values
at the places given by: (Line):(Column).
17:44
So easily fixed by generating, instead
if _ERROR_ then call symput('_EFIERR_','1');
Regards
Peter Crawford
Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
29/04/03 15:50
Please respond to Gerhard Hellriegel
To: SAS-L@LISTSERV.UGA.EDU
cc:
Subject: Re: A strange problem.
On Tue, 29 Apr 2003 08:28:27 -0400, Fehd, Ronald J. (PHPPO) <rjf2@CDC.GOV>
wrote:
>> From: tina [mailto:tyang@ARCHES.UGA.EDU]
>> I am not very good with SAS and have no idea how to solve
>> this problem. I sincerely hope that someone can help me with this.
>>
>> I have a dataset that I created from a text file,
>
>classic gotcha for WinDoze:
>variable length records, which result in
>"SAS went to new line"
>warnings
>read your log and see what the widest/longest record length is
>and put that as the value of lrecl:
>
>infile TEXTFILE
> lrecl = 80 pad <---<<<
> ;
>
>Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
>
>My computer must be broken:
>whenever I ask a wrong question,
> I get a wrong answer.
>-- Pot-Shots by Ashleigh Brilliant
>
>My computer must be broken:
>whenever I read a file with variable length records
> I get a wrong answer.
>-- Tina
... you should also try out the options for infile like MISSOVER or
TRUNCOVER, which normally gets you out of "SAS went to a new line..."
The default max-lrecl is 255, maybe too small. Set it to a higher value in
that case!
|