Apologies if this is a duplicate, but I haven't seen an answer that solves this for me.
tl;dr - I have a valid Library that I can successfully call against in manually submitted code, but when I try to run a background submit i get a "Libref is not assigned" error. Running SAS Studio 3.7.
I can't really share my libname statement as it contains company-specific info, but suffice it to say that after running the Libname program the library shows up in my list, and I can open it to view the contained datasets. My PROC SQL program runs error-free if I manually click the "run" icon, but when saved and run via right-click > backgrounds submit I get the Libref error:
ERROR: Libref HIVE3 is not assigned.
Is this a known issue? The library reference in my PROC SQL code was a drag-and-drop from the Library list, so there are no typos.... it just doesn't make sense to me.
63 options obs=max;
64
65 proc sql;
66 create table A.SAMPLETABLE as
67 (SELECT conn_id, emp_id FROM HIVE3.CP2_FINAL);
ERROR: Libref HIVE3 is not assigned.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
73 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Thanks!!
Your LIBNAME statement needs to be included in your background submit as this is a separate SAS session. Is it?
Your LIBNAME statement needs to be included in your background submit as this is a separate SAS session. Is it?
@MattatRBC wrote:
.....
after running the Libname program
That's the point. You need to include the code of your "libname" program into the code you run as background submit. Since a completely new SAS instance is created temporarily for the background execution, it does not have the "prior knowledge" you get in the workspace server, where the SAS instance stays active for the whole duration until you disconnect from it.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.