I'm kind of confused about what a library is. I think it's just a folder that contains folders and files, but this is not clear to me. If a library doesn't have any files (but rather has files in subfolders), will files not be accessible? Would we/can therefore add another libref to a subfolder to access those files within subfolders?
Whatever folder(s) the LIBNAME statement mentions must contain the SAS data set files. SAS doesn't look in subfolders, unless you specifically state the subfolder in the LIBNAME statement.
Would we/can therefore add another libref to a subfolder to access those files within subfolders?
Other way around ... add a subfolder to the LIBNAME statement.
I have a question about library in SAS ODA. In the screenshot shared below, please see the library 'CURESDAY', which was originally created as a SAS ODA library and it used to be displayed as a library under 'My Library' folder. However, from yesterday I don't see that library listed under 'My library'. Instead, I see it under files table. Also, please note that 'Files (Home)' used to be displayed on the left-hand panel of the screen, but it is currently now showing there either.
Please advise on how I can see my "CURESDAY" library and 'My Files (home)' items on the left hand side of my SAS ODA screen as it was shown earlier until yesterday evening.
Thank you in advance for your advice.
With regards,
Cool feature in SAS Studio is you can right-click on a folder when in the Server Files and Folders tab, & then select Create -> Library. This will bring up a pop-up window where you can supply the libref for this folder & also check a box to assign the library every time you start SAS Studio so you never have to do this again (librefs are deleted when you close or reset your SAS session).
Note: This only works for creating Base SAS libraries.
Thank you for your advise. But I beleive I could convey my encountered issue clearly. I wanted to mean that my encirled folders in blue line were once shown on the left hand side menu, but at present they seem to have disappeared from the left hand side menu. How can I bring these essential folders such as "odaws01-ws2' folder , 'File (home)' , and a library folder named 'curesday' etc. back to left hand side menu? Thank you once again. (please see the screenshot in this regard shared below and also attached as PDF file. Thank you.)
Thank you Mr. Grant for your response!
Please see attached the screen shot in pdf format (the same screenshot is copied below in .jpeg format).
Please note that at present i don't see 'odaws01' folder, "files (home)" folder, and "CURESDAY" folder on the left hand side.
But they were available on the left hand side menu a previously. Something has happened, causing them to disappear (aparently to to another location that I am having issues in relocating).
Thank you.
Thanks for screen shot. So you've lost your Server Files and Folders tab. This is an easy fix. Go to the icon on Top Right that looks like a hamburger & click & select View. Then check the Server Files and Folders. Somehow it got un-selected.
A library in SAS is a reference to a location that contains SAS files like datasets, views or catalogs.
On UNIX systems and Windows that location is a directory.
Libraries cannot be nested (a library cannot contain another library, all libraries exist on the same level side by side).
It is possible to create a directory as a subdirectory of another, and assign library references to both, but when viewing from inside SAS, that hierarchy will not be represented.
SAS libraries access data. You set a library to some location (folder, database, Excel workbook). You can then references that library name when working with the data in those locations.
You can also check out the free SAS Programming course. Go to Lesson 2, then Accessing Data Through Libraries. Practices doing that with the Excel file, and folder paths.
It is possible to use multiple folders in one library
libname income ('corpsale','retail');
However, if a dataset is stored in both folders with the same name, sas uses the dataset from the first folder.
Seems like you can. Here is an example in the LIBNAME statement documentation: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/n1nk65k2vsfmxfn1wu17fntzszbp...
I tested it on my local SAS install and it worked.
libname x ('S:/workshop/data' 'S:/courses/SQLM6/data');
You can add multiple folders to a library, however, if you have files with the same name in multiple folders, sas will only use the first folder where the file is located
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!
Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.
Find more tutorials on the SAS Users YouTube channel.