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

Looking into creating subfolders in our libraries to help organize our info better.  In the FROM clause of a SELECT statement, we reference data sets using <library name>.<dataset name>.  Is there a way to reference a subfolder under a library?  For example, say we have a subfolder named "Company" under a library.  I don't think <library name>.Company.<dataset name> works.  Thanks in advance. 

 

Note we are using Enterprise Guide  7.15 HF6

1 ACCEPTED SOLUTION

Accepted Solutions
boilerbujddy
Calcite | Level 5

That worked perfectly, thank you!

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

SAS libraries are one level only. You can't have a library within a library.

So if you have

saspath
    libraries
        lib1
            lib2

in your directory structure, you have to do

libname lib2 '/saspath/libraries/lib1/lib2';

and use

lib2.dataset

but you can't address lib2 by simply assigning lib1:

libname lib1 '/saspath/libraries/lib1';

and then use

lib1.lib2.dataset

in your code.

boilerbujddy
Calcite | Level 5

That worked perfectly, thank you!

novinosrin
Tourmaline | Level 20

Hi @boilerbujddy   You missed to mark @Kurt_Bremser  solution .  Request you to kindly change so that viewers can find the solution at ease during their search.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 961 views
  • 0 likes
  • 3 in conversation