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

Hi,

I have created a libref in one of the job and tried to access that from another job in the DI studio but it showing the following error.

ERROR: Libref is not assigned.

Please let me know how to resolve this issue at the earliest.

Regards,

Siva

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi, if you need the LIBNAME statement to be "globally" assigned, either think about putting your LIBNAME statements into either an AUTOEXEC file on the server -- that will be invoked every time SAS starts up. OR, have each of your jobs use a %INCLUDE to include the file with your LIBNAME statements so you know it is available before the rest of your code runs. If these are metadata libraries and you want the security of the BI Platform, then use the META form of the LIBNAME statement (your libraries and tables will need to be registered in the metadata for you to use the META engine).

cynthia

View solution in original post

9 REPLIES 9
ChrisHemedinger
Community Manager

You haven't provided a lot of details, but it's possible that you have an error in the LIBNAME assignment.  You don't always see the error right away -- not until you go to USE the library in subsequent code.

Check the details of your libref assignment where you created it, and perhaps add some code to test access immediately.  Then see if it works in your other job.

Chris

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.
sivaram_veerabagu
Calcite | Level 5

Hi Chris,

Thanks for the information. I have checked my libname assignment and it is working fine. I need the libname assignment to be globally declared, so that it can be used by all other following DI jobs in the flow.

Regards,

Siva

Cynthia_sas
SAS Super FREQ

Hi, if you need the LIBNAME statement to be "globally" assigned, either think about putting your LIBNAME statements into either an AUTOEXEC file on the server -- that will be invoked every time SAS starts up. OR, have each of your jobs use a %INCLUDE to include the file with your LIBNAME statements so you know it is available before the rest of your code runs. If these are metadata libraries and you want the security of the BI Platform, then use the META form of the LIBNAME statement (your libraries and tables will need to be registered in the metadata for you to use the META engine).

cynthia

sivaram_veerabagu
Calcite | Level 5

Hi Cynthia,

Thanks for the information. I made the libname globally by adding into AUTOEXEC file on the server.

Regards,

Siva

Patrick
Opal | Level 21

Having this definition in the autoexec instead of metadata will work but is especially for use in DI Studio certainly not best practice. It should be defined in SAS Metadata.

Patrick
Opal | Level 21

With DI Studio being metadata driven I'd say "best practice" would be to define everything in metadata - the library as well as the tables used in any of the DI jobs.

sivaram_veerabagu
Calcite | Level 5

hi Patrick,

Thanks for your feedback.

Regards,

Siva

SASKiwi
PROC Star

DI Studio is very much a metadata-driven product, so it would be sensible to define all commonly-used data libraries required by DI Studio in metadata. These libraries may useful in other SAS tools as well like EG and SAS Studio.

Maicfelps
Calcite | Level 5
Hi Silva,

when you create a new libname never forget to assign the server , No Way, Library Properties, Assign and choose the current server

Maicfelps

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 110368 views
  • 8 likes
  • 6 in conversation