Hi All,
I managed to import zipped CSV files using the following code:
FILENAME ZIPFILE SASZIPAM "Z:\Data\fname001.zip";
data work.imported. (COMPRESS = YES);
infile ZIPFILE(fname001.csv)
delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2;
informat a b c ;
format a b c;
input a b c;
run;
However, sometimes when I am importing large CSV files (~4.5m rows, >8GB in without zipping), I encountered I/O error.
After trial and error, I noticed that I can successfully import using the above code by reducing the observation read in by 1 row, using the OBS= option after FIRSTOBS=2;
This brought me two questions:
Why was there an I/O error only when the last row included?
How can I know the total number of rows in the CSV file so that I can skip the last row when building an import macro?
Thanks.
... View more