BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jdmarino
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Have you tried including the ignoredoseof option in your infile statement?

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

Have you tried including the ignoredoseof option in your infile statement?

jdmarino
Fluorite | Level 6

That worked!  SAS is such a multi-headed monster, "it takes a village" (this community) to tame it.  Thanks.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1219 views
  • 0 likes
  • 2 in conversation