DATA Step, Macro, Functions and more

can I create a library inside one lib?

Reply
SAS Employee kwu
SAS Employee
Posts: 34

can I create a library inside one lib?

I am on windows. When I create a library (e.g. testlib) and map it to a file directory on the file system (e.g. c:\dir ), the sub directory of c:\dir\subdir does not show up in the sas exploer as the sub lib of testlib. I wonder if there is a way so that I can have the sas explorer shows the same directory structure as the file system?

I only need one level of nesting, at least be able to create a sub lib in a lib.

I tried to
libname testlib.subdir "c:\dir\subdir";

it doesn't work. Any suggestion or work around?

thank you in advance.
Valued Guide
Posts: 2,177

Re: can I create a library inside one lib?

There is more than one SAS explorer. In what context are you? EG or old SAS?
SAS Employee kwu
SAS Employee
Posts: 34

Re: can I create a library inside one lib?

I do not know what EG is even. It is in the base SAS. The version I am using is sas9.2.
PROC Star
Posts: 7,471

Re: can I create a library inside one lib?

Would assigning the directory to My Favorite Folders suffice?
SAS Employee kwu
SAS Employee
Posts: 34

Re: can I create a library inside one lib?

How do I use the favorite folders as lib in the sas code?
PROC Star
Posts: 7,471

Re: can I create a library inside one lib?

Peter is probably more familiar with this topic than I am. I understood that you were simply looking for a way to point-and-click your way to view files within subdirectories.

That said, you could probably combine Favorite Folders with file shortcuts to be able to reference them within your code.

Take a look at: http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#refextfile.htm
or, in short form: http://xrl.us/bh2uys

Art
SAS Employee kwu
SAS Employee
Posts: 34

Re: can I create a library inside one lib?

here is what I am trying to do:

we have a datamart which maps to a sas library, now we are partitioning one of the big tables inside the datamart. I hope I can store partitions inside the same sas library but not directly, instead all partitions are stored in a sub library.
is there a way to do so?
PROC Star
Posts: 7,471

Re: can I create a library inside one lib?

Will concatenating lhe libname to include both suffice?

Art
PROC Star
Posts: 7,471

Re: can I create a library inside one lib?

If you're not familiar with concatenating libraries take a look at:

http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000933322.htm

Art
SAS Employee kwu
SAS Employee
Posts: 34

Re: can I create a library inside one lib?

I am aware of the concating lib. It does not really do what I want since the concated lib has all dataset. I do not want to expose the partition datasets in the library.
Super User
Posts: 19,789

Re: can I create a library inside one lib?

Out of curiousity why not just have two lib statements with a set naming structure to define the two libraries? Yes the character limit is a restriction...

libname orig 'C:\test';
libname origsub 'C:\test\subdir';

If you want to physically view in Explorer use the favorite folders.
Valued Guide
Posts: 2,177

Re: can I create a library inside one lib?

> here is what I am trying to do:
>
> we have a datamart which maps to a sas library, now
> we are partitioning one of the big tables inside the
> datamart. I hope I can store partitions inside the
> same sas library but not directly, instead all
> partitions are stored in a sub library.
> is there a way to do so?


Are you seeking to eplore through to the whole data mart as one table instead of partitions?

If so then may I suggest one way and a possible alternative?
Create an SQL view over all partitions in a new library holding only the view.

The alternative would be to create the SAS data mart using a spde library
SAS Employee kwu
SAS Employee
Posts: 34

Re: can I create a library inside one lib?

thank you very much for all the suggestions. I will just use two libs.

I was expecting to have the lib.sublib.dataset type of structure, which I do not think sas support the nested dot notation thing. Smiley Happy
Ask a Question
Discussion stats
  • 12 replies
  • 728 views
  • 0 likes
  • 4 in conversation