SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

data is cut off because it is too long in a row

Accepted Solution Solved
Reply
Contributor
Posts: 52
Accepted Solution

data is cut off because it is too long in a row

For the data in the attached file, I used the below code to repull the data.  However, the data has been cut off in the middle because the data in a row is too long.  Is there a way to set some number such that the data is not cut off?  Thank you for the help.

 

data want ;

length filename fn $200 ;

infile 'C:\Users\*.txt' filename=fn eov=eov length=ll column=cc truncover ;

fileno+1;

do row=1 by 1 until (eov) ;

do col=1 by 1 until (cc>ll);

input num @ ;

filename=fn ;

output;

end;

input;

end;

run;


Accepted Solutions
Solution
‎01-11-2016 08:47 AM
Super User
Posts: 19,822

Re: data is cut off because it is too long in a row

Posted in reply to wutao9999

All Replies
Solution
‎01-11-2016 08:47 AM
Super User
Posts: 19,822

Re: data is cut off because it is too long in a row

Posted in reply to wutao9999
Respected Advisor
Posts: 4,927

Re: data is cut off because it is too long in a row

Note: The default LRECL under Windows was increased in SAS 9.4 to 32767 . OP is probably running an earlier version where the default LRECL under Windows was 256.

 

http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#chifoptfmain.htm

PG
Respected Advisor
Posts: 4,927

Re: data is cut off because it is too long in a row

Posted in reply to wutao9999

... Also, the eov variable is set to 1 after you read a line from the next file and it is not reset by SAS. Try this logic:

 

data test;
length fn filename $200;
infile "C:\users\*.txt" filename=fn eov=eov 
    length=ll column=cc truncover lrecl=2000;
input @; /* Read a line to trigger eov */
if eov then do;
    fileno + 1;
    row = 0;
    eov = 0; /* reset eov */
    end;
row + 1;
filename = fn;
do col = 1 by 1 until(cc>ll);
    input num @;
    output;
    end;
run;
PG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 576 views
  • 0 likes
  • 3 in conversation