I have a MS Access database. I am required to process and update tables in this database with SAS. The tables can be very large. Some of the processing requires the use of pure SAS functions. With a SAS/ACCESS LIBREF to MS Access, you cannot update or alter tables with PROC SQL. Therefore, I see two approaches:
- Using LIBREF: Copy the entire table into SAS. Delete the original table in Access. Process the table in SAS. Write the table back to Access.
- Using PROC SQL passthrough: Read the rows I need into SAS. Process these rows using SAS. Update the rows in Access.
My question: is number 2 even possible? With SQL functions (rather than SAS), the process outlined in number 2 is many orders of magnitude faster than number 1. I understand that this difference comes from the data being processed entirely by the DBMS, but number 2 would still have to be faster, right?
For future readers: I asked this question because SAS does not support a
PROC SQLUPDATEstatement on a MS Access library. To update an Access table, you must create a new table in the database and use a pass-through statement. My first instinct was to use anUPDATEstatement assigning with aWHEREclause to update a subset of records. While I was researching this, I read some bad information that said Jet SQL did not support updating a subset of records. This is incorrect. Using anINNER JOIN, you are able to update a subset. Example code below: