The transition from SAS© 9.4 to SAS© Viya™ often comes with a learning curve regarding in-memory data management. A common confusion arises when transitioning from PROC SQL to PROC FEDSQL to interact with tables loaded in CAS libraries (CASLIBs).
If you have ever encountered the error "BASE driver, schema name... was not found", this article explains why it happens and how to fix your code.
Imagine you are working in a SAS© Viya™ environment. You have defined a path-based CASLIB and loaded a table into memory.
Here is the typical configuration:
Defining the CASLIB and Libref:
Loading Data In-Memory:
You use PROC CASUTIL to load a table (e.g., test.sashdat) into the CAS server's memory.
So far, everything is working. The table is accessible in memory under the name mycas.test.
To perform an aggregation (like a GROUP BY), you decide to use PROC FEDSQL, which is the standard SQL implementation for the CAS engine.
You attempt to run the following code:
This is where the system returns the blocking error:
The error does not stem from a library configuration issue or a missing file. It is due to the way PROC FEDSQL communicates with the CAS server.
Unlike a classic SAS© procedure that runs locally, PROC FEDSQL needs to explicitly know in which CAS session it should operate to access in-memory tables. If no session is referenced, the procedure attempts to find the table via the local engine (BASE driver), which does not know the "MYCAS" schema defined on the remote server.
To fix this issue, you need to do two things:
Ensure a CAS session is active.
Tell PROC FEDSQL to use this session via the SESSREF option.
Here is the corrected code:
What to Remember
Adding the sessref=YourSessionName option is essential when you manipulate CAS tables directly with FedSQL. This creates the necessary bridge between your code and the data residing in memory on the Viya™ cluster.