BookmarkSubscribeRSS Feed
kwu
SAS Employee kwu
SAS Employee
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.
12 REPLIES 12
Peter_C
Rhodochrosite | Level 12
There is more than one SAS explorer. In what context are you? EG or old SAS?
kwu
SAS Employee kwu
SAS Employee
I do not know what EG is even. It is in the base SAS. The version I am using is sas9.2.
art297
Opal | Level 21
Would assigning the directory to My Favorite Folders suffice?
kwu
SAS Employee kwu
SAS Employee
How do I use the favorite folders as lib in the sas code?
art297
Opal | Level 21
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
kwu
SAS Employee kwu
SAS Employee
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?
art297
Opal | Level 21
Will concatenating lhe libname to include both suffice?

Art
art297
Opal | Level 21
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
kwu
SAS Employee kwu
SAS Employee
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.
Reeza
Super User
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.
Peter_C
Rhodochrosite | Level 12
> 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
kwu
SAS Employee kwu
SAS Employee
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. 🙂

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
  • 12 replies
  • 2385 views
  • 0 likes
  • 4 in conversation