My apologies if this info is somehow already in here somewhere. I cannot find it. Perhaps my search terms are not adequate.
Anyhow, I'm looking to create "subfolders" for the shared datasets my group is storing. You see, our company has not yet agreed to provide an actual SAS server, so for the time being we are stuck using libnames to point to folders on a file server to share data. In the beginning, we only had a few datasets, so we were content to have a structure like this :
Local
--> Libraries
-->FolderOnFileServer
-->Dataset01.sas7bdat
-->Dataset02.sas7bdat
-->Dataset03.sas7bdat
-->etc...
Now, however we have a large number of datasets and having them all under 1 folder (libname) is getting a bit unwieldy. I would like to create a structure similar to the below, but can't seem to find any clear documentation on how to do so. Any (constructive ) would be greatly appreciated. Thanks. -John
Local
--> Libraries
-->FolderOnFileServer
-->SubFolder01OnFileServer
-->Dataset01.sas7bdat
-->Dataset02.sas7bdat
-->SubFolder02OnFileServer
-->Dataset03.sas7bdat
-->Dataset04.sas7bdat
-->SubFolder03OnFileServer
-->Dataset05.sas7bdat
-->etc...
SAS libraries are always flat, there can be no hierarchy beyond library.member.
Hierarchies are possible in the "Files" section of the server.
Your file server is most likely a network drive.
You can create folders using dcreate function.
Or if you can navigate to the folders via Windows or Unix you can create them the old fashioned way
It won't show up nested that way in SAS, more of a linear path instead
Yes. I should be more clear. I've already created the folder structure on the file server. That is not an issue. It's getting them tree structure to appear that way in SAS for which I'm looking. I've seen folders nested like this in an actual SAS server library tree, but not on a local.
John, Are you talking about library tree with many layers?
Haikuo
From the root local server library (yellow), there would 2 additional layers. Currently I can only create 1 (green)
Local
--> Libraries
-->FolderOnFileServer
-->SubFolder01OnFileServer
-->Dataset01.sas7bdat
-->Dataset02.sas7bdat
-->SubFolder02OnFileServer
-->Dataset03.sas7bdat
-->Dataset04.sas7bdat
-->SubFolder03OnFileServer
-->Dataset05.sas7bdat
-->etc...
I don't think that's possible.
When I even see that in my server, the multiple links are via different server connections.
SAS libraries are always flat, there can be no hierarchy beyond library.member.
Hierarchies are possible in the "Files" section of the server.
John,
Like and have already pointed out, SAS Base Library hierarchy can only have two laryers: Table and Library. However, noticing you are using EG, so there is possibility you can "achieve" the result using Metadata folder structure. You can set up OS alike folders, which can be nested many layers, with very literal naming conventions, and then point your libraries and tables to these folders regardless how they are stored physically. The way I like is to use Metadata library names as the folder name, so when I need a standalone code, I can easily determine the library name (metadate), then call it upon using Meta engine.
Hope this helps,
Haikuo
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.