BookmarkSubscribeRSS Feed
MohamedS
Obsidian | Level 7
Hi,

Do anyone know, how to build a library one time such in batch or config and to be shared through all sas components and modules without typing libname statement again?
1 REPLY 1
deleted_user
Not applicable
The libname definition exists to a SAS session as long as "sas ... " is running. As soon as the SAS session goes away, the libname definition goes away for that session.

BUT,

the libname can be automated through a couple different mechanisms that I know of so that it is not necessary to code it into every SAS program:

1) autoexec.sas can be used to issue commonly used libname definitions.

2) A metatdata server. It is possible to have a sas session connect to a metadata server and for the server to then automatically provide access to libraries. Even batch SAS can do this, not just with EG and other SAS products.

We, where I am, have PC SAS on our local workstations and access to multiple SAS servers. We have an autoexec.sas file on our local PC's that points to another "autoexec.sas" file on our common server, which then %include's a file we call "LibaryDefinitions.sas". The autoexec's are specific to each user, but the LibraryDefinitions.sas file is common to all of our group's users and programs. It defines commonly used filenames libnames and options. This provides a single point of reference and maintenance, and insures commonality and portability. It also is a productivity aid since we don't have to code all that stuff every time into our programs. And, due to many issues (local and with SAS) we use it for our Logical EG servers as well, instead of the MetaData Libraries; although, I suppose with better administration, we could make more use of the MetaData Server.

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 807 views
  • 0 likes
  • 2 in conversation