11-07-2014 12:10 PM
I have an Access database (accdb) with several long text variables. When I import it to SAS, they are truncated to 3 characters (including many and with a question mark, like xx?)
11-07-2014 01:22 PM
This is what I use
Proc import out=test datatable="datatable" dbms=access replace;
11-07-2014 04:02 PM
I would suspect the MEMOSIZE option was set to 3 but you didn't show that in the code.
If the source data set isn't too large I would try exporting if from Access to a CSV file and look at that. If that looks okay then import that into SAS and see if there are still issues. If so, then you may issues related to the actual content.
11-07-2014 04:12 PM
I tried to set memosize to a big number but it did not work
When I exported it from Access to Excel, things looked OK (but I lost a date/time variable which only the date part showed up) and I was able to import to SAS without that truncate problem.
But I hope we could do the import from Access without going through Excel
11-13-2014 09:24 AM
I would suggest that you export your access data to CSV, then datastep to read it in - this gives the benefit of being able to see the data in plain text and having control over what happens at read in time. I would also recommend not using Access, but that's just my opinion.
11-13-2014 12:23 PM
By default, Proc Import uses the first 20 rows of the dataset to determine the length of the variables. If your memo field doesn't have any content for the first few records, SAS might assume that the field is short. You can try using the guessingrows option in proc import to increase the number of rows SAS uses to determine the variable size. Just add the following statement somewhere after the import statement (I used 100 rows as an example, but this can be anything):
If you really want to control the size of the variable, though, you'll probably have to use a data step instead of Proc Import.