Difference between normal libraries and METADATA Libraries

Accepted Solution Solved
Reply
Super Contributor
Posts: 268
Accepted Solution

Difference between normal libraries and METADATA Libraries

Hi,

I just created a sas library using SAS MC with the following info -

LIBNAME SASCLNT BASE "F:\sasusers2\saspert";


I can see the library in EG. But when I try to run a query and create a sas dataset in SASCLNT, it asks me to use proc metalib or metaout= option to register the table in SAS MC.

 

Shouldnt EG show me the dataset in SAS library? In my previous client, my environment was different. It was a unix server with libraries pointing to the production data. As soon as I created the dataset, it would show up in the SAS EG library without having the need to register it. 

 

Thanks,

saspert


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
Super User
Posts: 3,101

Re: Difference between normal libraries and METADATA Libraries

[ Edited ]

To ensure your datasets show automatically without registering them, go into the Properties of the library you defined in SMC, select the Extended Attributes tab then add the FieldName AssignMode and set the value of the field to 2.

 

Do this on all metadata-defined libraries where you want your datasets to show automatically in the EG server list.

 

This link explains things in more detail: http://support.sas.com/documentation/onlinedoc/guide/EG43MetaLibraries.pdf

 

 

 

View solution in original post


All Replies
Solution
‎09-25-2015 06:23 AM
Super User
Posts: 3,101

Re: Difference between normal libraries and METADATA Libraries

[ Edited ]

To ensure your datasets show automatically without registering them, go into the Properties of the library you defined in SMC, select the Extended Attributes tab then add the FieldName AssignMode and set the value of the field to 2.

 

Do this on all metadata-defined libraries where you want your datasets to show automatically in the EG server list.

 

This link explains things in more detail: http://support.sas.com/documentation/onlinedoc/guide/EG43MetaLibraries.pdf

 

 

 

Super Contributor
Posts: 268

Re: Difference between normal libraries and METADATA Libraries

[ Edited ]

Thank you SASkiwi! that is exactly what i wanted. Now a stupid question - a) so can SAS EG treat a metalib as a normal native sas library.

 

A client-environment specific question: We have a MS sql server database. We have a sas library pointing to one of the schemas and I think we have the setting to show only the metadata registered tables. 

b) My question is if I create a sas dataset in the metadata, does that automatically write a table back in the MS SQL server database schema (assuming I have all sas privileges).

Or alternatively How do I check if MS Sql server allows a sas user or a sas admin to write a table to its schema? 

 

I checked with my supervisor and he insists that sasusers do not have sufficient privileges to write to a ms sql server db. So let me rephrase the question - 

If I change the option for this MS SQL server db to show all tables in that schema in the metadata and I write a new dataset to the library, how do I know which ones are native ms sql server tables and which ones as sas datasets. Or is it better to have 2 separate libraries (one that is an ODBC driver pointing to MS sql server and the other native SAS library with access to MS Windows NT server level) ? 

 

Hope my question makes sense. 

 

Thanks,
saspert.

Super Contributor
Posts: 268

Re: Difference between normal libraries and METADATA Libraries

So after I created a test dataset in the new library, I tried to delete it using SAS EG window at the bottom left.

 

[Error] You cannot delete MYLIB.CLASS.DATA because MYLIB.CLASS.DATA is in use by you in resource environment METAREB. c)What am i missing here?

 

d)Is it possible to write to a sas VA library directly just like the sas paper suggested? we have 3 (i think all are default) VA libraries 

 

 

 

Super User
Posts: 3,101

Re: Difference between normal libraries and METADATA Libraries

[ Edited ]

The most likely cause is that you have the table open in EG for viewing. Once you delete the table from the "process list" you should be able to delete it.

 

SQL Server libraries can be set up in metadata, just like SAS libraries. They behave just like LIBNAMEs written in code. The process for setting them up is a bit more involved but is not difficult once you have done one or two. All SQL Server libraries obey the database's permissions. If you are given read-only access you wont be able to write to the database. The SQL Server tables you see in the EG server list are the actual SQL Server tables not "copies" in SAS. When you view one of these tables SAS reads the data directly out of the database to SAS so you see it screen by screen.

 

You can't mix SAS and SQL Server library definitions either in code or in metadata, they must either be one or the other.

 

Here is another tip: I suggest you add a prefix to the names of all of your SQL Server metadata library definitions so to tell them apart from the SAS ones. We use the prefix SQL.

Super Contributor
Posts: 268

Re: Difference between normal libraries and METADATA Libraries

great thanks!

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 507 views
  • 1 like
  • 2 in conversation