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

Hi, guys.

     I am using C# to develop my own SAS client, a problem came out when I get the SAS libraries list. At first, I have already finished to connect to the remote SAS server. Here is the problem:

When I use EG to connect the SAS server, there is 11 libraries, 3 of them is defined in MC. If you want to use them, you must assign them first.

eg.png

But in my own client, I use the method "ListLibrefs" of SAS.DataService, I can only get 8 libraries, can't get the 3 libraries defined by MC.

client.png

And I use the same user to login the SAS server. How to get the libraries defined in MC, and assign them?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Those libraries that are defined in metadata and shown in white in EG - they are "potential" libraries.  They have definitions in SAS metadata but they are not assigned.

To assign them, you would use a LIBNAME statement or an AssignLibref API call, and use the META engine:

libname month META library="Month Data";

To learn which libraries are available in metadata, you must issue a metadata query.  I have a PowerShell example that you can adapt here:

Using Windows PowerShell to find registered tables and columns in SAS metadata - The SAS Dummy

This example discovers "PhysicalTable" objects, but you can issue a similar request for SASLibrary objects.  You might find a PROC METADATA example that shows the metadata query that you need.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

4 REPLIES 4
TomKari
Onyx | Level 15

Very interesting application!

For this one, I suggest you put in a case to SAS Tech Support. If you haven't used them before, they're very good, and I'm sure they'll be able to help you.

Your problem delves into corners of SAS that aren't that heavily used, so I'm not sure the discussion forums will be able to pop up an answer.

Tom

ChrisHemedinger
Community Manager

Those libraries that are defined in metadata and shown in white in EG - they are "potential" libraries.  They have definitions in SAS metadata but they are not assigned.

To assign them, you would use a LIBNAME statement or an AssignLibref API call, and use the META engine:

libname month META library="Month Data";

To learn which libraries are available in metadata, you must issue a metadata query.  I have a PowerShell example that you can adapt here:

Using Windows PowerShell to find registered tables and columns in SAS metadata - The SAS Dummy

This example discovers "PhysicalTable" objects, but you can issue a similar request for SASLibrary objects.  You might find a PROC METADATA example that shows the metadata query that you need.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Slash
Quartz | Level 8

Thanks, Chris!

Actually, I read your blog "Build your own SAS client app with Microsoft .NET" recently, and I started to build my own client.

So I believe there are lots of  problems I'm gonna ask you.

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 4 replies
  • 936 views
  • 1 like
  • 3 in conversation