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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 107500 views
  • 8 likes
  • 6 in conversation