I'm trying to read a file with 6.7M records, but my data step quits after only 105k with no errors. There are control codes in the file that convinces SAS that the file has ended. The file is an exported .csv file from the RapidSQL query tool on the same platform (WinXP, SAS 9.2). (FYI, when I tried to read the data directly from the server via ODBC, it got stuck. It ran overnight; I killed it and got no results.) I can import the first million rows into excel, and, indeed it contains a funny character in the line that SAS stopped on. It's character hex 1A, which is ctrl-z, the EOF character.
Q: Can control characters be cleaned out using SAS?
The (vastly simplified) code:
data blah ;
infile "textfile.csv" lrecl=32767 ;
input;
An excerpt from the log:
NOTE: The infile "textfile.csv" is:
Filename=C:\Projects\xxx\textfile.csv,
RECFM=V,LRECL=32767,
File Size (bytes)=962846799,
Last Modified=16Jan2013:13:19:58,
Create Time=16Jan2013:13:04:55
NOTE: 105454 records were read from the infile "textfile.csv".
The minimum record length was 128.
The maximum record length was 146.
Have you tried including the ignoredoseof option in your infile statement?
Have you tried including the ignoredoseof option in your infile statement?
That worked! SAS is such a multi-headed monster, "it takes a village" (this community) to tame it. Thanks.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.