Desktop productivity for business analysts and programmers

A problem about get SAS library defined by MC

Accepted Solution Solved
Reply
Contributor
Posts: 67
Accepted Solution

A problem about get SAS library defined by MC

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?


Accepted Solutions
Solution
‎08-18-2013 11:06 AM
Community Manager
Posts: 2,887

Re: A problem about get SAS library defined by MC

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

View solution in original post


All Replies
PROC Star
Posts: 1,146

Re: A problem about get SAS library defined by MC

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

Solution
‎08-18-2013 11:06 AM
Community Manager
Posts: 2,887

Re: A problem about get SAS library defined by MC

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

Contributor
Posts: 67

Re: A problem about get SAS library defined by MC

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.

Contributor
Posts: 67

Re: A problem about get SAS library defined by MC

Thanks!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 312 views
  • 1 like
  • 3 in conversation