12-29-2015 08:51 AM
I am a new user working with SAS Enterprise Guide and I have been trying to import a very large .txt file, with over 10 million rows and around 18 columns.
I have tried the wizard, which does not bring all the records, so I tried the proc import:
OUT = gc.20151108TESTE;
DBMS = DLM replace;
DELIMITER = '|';
The code imports fewer lines than the wizard. I can't seem to find a way to import all of the rows! Any help appreciated.
12-29-2015 09:49 AM
Could you try following code:-
data work.temp ;
lrecl = 32767 <or whatever is your file length>
delimiter = '|'
firstobs = 1 /*Give this value as 1 if your text file does not contain column name. If your file contains column name this value will be 2*/;
attrib <col1> length = $32;
attrib <col2> length = $8;
attrib <col3> length = $26;
/*This will continue till col 16*/
input <col1> <col2> <col3>......<col16>;
12-30-2015 04:47 AM
Try adding option IGNOREDOSEOF to your infile statement.
Thansk PG, I did just that yesterday after I learned there were special characters on the txt file. It worked like a charm.
I had to get an IT guy to open the file for me because I dont have any tools to open such a big file, but when i tried to load another file and analysed the last line it imported and finding a very similar error, it was just a matter of finding what was wrong with the file.
12-29-2015 02:57 PM
12-29-2015 08:25 PM
12-29-2015 09:04 PM
What did your SAS LOG display ? Is there any WARNING or ERROR message? I also notice OUT = gc.20151108TESTE; in your code. It is not right. SAS table name can't be start with a digit .
This was posted in SAS EG forum, and unfortunately SAS EG sets the option validvarname=any by default.
Need further help from the community? Please ask a new question.