Hello ajuhack, I have attached 3 macros that you might like to try. The main macro is called %read_csv_data.sas - it calls the other 2 macros. I have learned by experience not to trust proc import for the very reason that it uses guessingrows. If you are guessing, you will always run the risk of data truncation. My solution is to perform 2 passes (in the way Cynthia suggested). Actually, because of my environment, it also reads the top 100 lines first, before doing the full reads, to determine if lines are CRLF or LF terminated! It searches the top 100 lines for a header record, in order to work out column names. It searches for a delimiter, or you can specify it if you know it. It reads all of the data into character variables - so you will need to convert numerics and dates afterwards. In my test file of 95,000 obs it takes about 1 minute to run on my AIX server. My other test file of 410MB and over 10 million obs takes 8 or 9 minutes. SAS is good like this - the first full read of the text file takes 7.5 minutes, and the second read takes 40 seconds. I hope you find this useful. Tim.
... View more