Help using Base SAS procedures

infile problem

Reply
Contributor
Posts: 33

infile problem

Hi all,

I am using a simple infile statement to read in about 4 million records. For some reason sas stop at reading 700,00 and does not read the full file in. As the txt file is about 4gb i can not open it to see why. Having a look at the last record in the table i can not see why it is stopping. Any ideas? Thanks in advance
N/A
Posts: 0

Re: infile problem

Posted in reply to sasbegginer
In case you are using Windows, you can find some file-splitter utility. Anyway, a piece of your log would be useful.
Super Contributor
Super Contributor
Posts: 3,174

Re: infile problem

Posted in reply to deleted_user
Agreed - SAS log with DATA step code would be helpful - and you may find setting END=EOF on the INFILE useful while doing some code like:

IF EOF THEN PUTLOG _INFILE_;

or use some HEX type SAS format to display the last record as SAS interprets the end-of-file condition.

Scott Barry
SBBWorks, Inc.
Trusted Advisor
Posts: 2,115

Re: infile problem

Posted in reply to sasbegginer
If you are on a PC and your text file includes a CTRL-Z, SAS will stop reading it. CTRL-Z is the (antique) end-of-file indicator left over from V6 days.
Respected Advisor
Posts: 3,799

Re: infile problem

Perhaps the option

IGNOREDOSEOF
is used in the context of I/O operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.
Respected Advisor
Posts: 4,173

Re: infile problem

Posted in reply to sasbegginer
If the issue is caused by a control character then eventually the following code will help:

data want;
infile ;
input @;
_infile_=COMPRESS(_infile_, , "c");
input ;
run;

If this works and you want to find the line with the control character then:

if length(_infile_) ne length(COMPRESS(_infile_, , "c")) should do the job.

You could of course also use find() or indexc() - but I assume compress will work faster.

HTH
Patrick
SAS Employee
Posts: 19

Re: infile problem

Posted in reply to sasbegginer
You aren't using Learning Edition, are you?
If so, you are limited in the number of observations, so you could be hitting that limit.
Ask a Question
Discussion stats
  • 6 replies
  • 486 views
  • 0 likes
  • 7 in conversation