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
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
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
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
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
Hi Cynthia,
Thanks for the information. I made the libname globally by adding into AUTOEXEC file on the server.
Regards,
Siva
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.
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.
hi Patrick,
Thanks for your feedback.
Regards,
Siva
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.