01-09-2016 06:44 PM
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 ;
do row=1 by 1 until (eov) ;
do col=1 by 1 until (cc>ll);
input num @ ;
01-09-2016 11:48 PM
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.
01-09-2016 11:37 PM
... 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;
Need further help from the community? Please ask a new question.