BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MattatRBC
Calcite | Level 5

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!!

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Your LIBNAME statement needs to be included in your background submit as this is a separate SAS session. Is it?

View solution in original post

4 REPLIES 4
SASKiwi
PROC Star

Your LIBNAME statement needs to be included in your background submit as this is a separate SAS session. Is it?

MattatRBC
Calcite | Level 5
You and KurtBremser were right - thank you!!

All of my other libnames live in the autoexec file, so I guess I had never run into this before.
Reeza
Super User
Usually, these have to do with permissions and/or accounts running the submit. If you're doing a remote submit, does that account have the same privileges? Is it running on the same location?
Kurt_Bremser
Super User

@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.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 1243 views
  • 1 like
  • 4 in conversation