09-20-2012 07:06 PM
Our team is new in SAS and i have joined new in team too as a SAS Admin role. I am also new at this role. We are using SAS EG and SAS Enterprise Miner currently.
My team is telling me to create SAS Library in sas management console so that they can write the code and store the dataset in that particular library through SAS Enterprise guide and AS Enterprise miner. Basically they want to store the data set that will be created by SAS EG/EM. Can you please tell me how i can do that? Any std procedure to do that?
Please let me know if i didn't explain this question correctly?
I also need to get this done ASAP. I would really appreciate help.
09-20-2012 11:10 PM
I am really seeking answer for this question because the big question is i am not sure even question is appropriate?
I am wondering if we can create library in SAS EG/MINER itself. Is that possible to create same with management console or not? I don't have access to SAS EG/MINER. Other team member has it so i cannot even check same.
09-21-2012 09:19 AM
As a new SAS admin, you could probably benefit from some basic training such as what's offered in this course:
SAS Management Console is good for managing information about libraries and for registering data sets. For particular nuances with SAS Enterprise Guide, you can check out the papers referenced here:
09-21-2012 11:58 AM
Once you can create library in SAS MC and register the tables then users can see those tables in SAS EG/Eminer(if the user have proper credentials to that library).
In EG it would be in SASAPP->library->librarynames
In Eminer when you create a source data then you need to metadata table to access the data from library or in project start up code they can directly mention the libref and path using simple libname statement.
If you are creating the library other than BASE SAS (for eg oracle library then you need to create the user and oracle server to access that library)
09-21-2012 03:36 PM
Hey Shiva, I have did same thing but now issue is users have to define llibrary each and everytime. If A name library is assigned then you can right down anytime with a.test1 or something like that, doesn't have to define libname everytime.
is there anything need to be done for same?
09-24-2012 04:11 PM
I have just been through a very similar exercise with a SAS install and found that the document referred to in Chris's link is most helpful:
We are using EG 5.1 and SAS 9.3 but the above document is still relevant for this version.
We have found that the best way to give users access to SAS data libraries is to define them in Management Console, but then to pre-assign them to the library native engine under the Advanced Options button in the Options tab of the library's properties.
By doing this users see all libraries and datasets in the EG Server List window after they connect to the SAS server and they can run any tasks or programs referencing these libraries without re-assigning them.
A second issue is if tables get added by users to these libraries, ensuring that all users can see these new tables without having to synchronise metadata. I found the easiest way to do this was to add AssignMode and set a value of 2 in the Extended Attributes tab of the data library's properties. Refer to the above document to understand what this does.
BTW we only pre-assign SAS libraries and not external database libraries. This is because of the extra resources required every time you connect to the SAS server creates too much of an overhead, plus external database connections tend to time out.
09-24-2012 04:19 PM
I'll need to update that document to reflect this new feature in SAS 9.3 Maint 2, called "Metadata-bound libraries":
In summary, this feature allows you to provide control over library access via metadata, the way that admins have been trying to do. It closes off the access to the data by any means other than the metadata-managed mechanisms.
It's not for everyone, but it's another tool you can use.
09-25-2012 03:57 PM
Excellent suggestion Patrick. I tried it and it works a treat! maybe that is something you can mention in your document Chris.
I've read up on metadata-bound libraries and come to the conclusion that this approach is not something you should undertake lightly nor simply to 'control' your SAS users. It would be appropriate if it is required to meet the security policies of your organisation.
09-26-2012 07:34 AM
Just to add to this:
When defining libnames for databases make sure that you understand and step through the available libname options and set them to appropriate values for your DB instance (options documented in the SAS/Access manuals).
The defaults are often way too low and I assume they are set this way to always work (also with "toy" instances of a DB).
Examples of options worth to check and change to something appropriate for your usage and instance of a DB: insertbuff, readbuff, dbmax_text, db_commit, ....
09-26-2012 08:34 AM
Thanks All, i have applied all logics and your help points. I have written down Assignmode/value=2/mataout=data on extended attributes.
One more prob i have with all libs is this warning msg.
"Multiple libraries detected in metadata that use same libref for server sasapp. This is not supported configuration and may be casue problems."
just mention different libref than libname? Is that all need to do?
09-26-2012 04:29 PM
Sandip - not exactly. Each Management Console Data Library definition has both a Data Library name and a LIBREF - how you refer to the library in SAS code. These are quite independent of each other and it doesn't matter if you call them the same or not. Our practice is to have the data library name the same as the LIBREF as then you get a consistent view in EG and what you would use in SAS code.
You can't use the same LIBREF in different data library definitions because which one do you want if you specify a LIBREF in SAS code that is used in multiple data library definitions. All you need to do is to go through all of your data library definitions and identify those with duplicate LIBREFs and change these so there are no longer duplicates (Options tab of Data Library properties).
Patrick - excellent advice. We usually change at least readbuff as most of external databases are for read-only purposes. Trying to figure out best practice with metadata libraries can be very trying...
09-24-2012 09:45 PM
Hello All, let me give more detail on this issue. Problem still there. Even i pre-assigned a library, error is still there.
I am using SAS Management Console 9.3 and SAS EG 5.1
I have created library name asif under sas management console
available server: SASMeta and selected server: is SASApp
path specofication: d:\SAS Data\DATA2
Authorization: grant everything tp SASUSERS
if i run below code in SAS 9.3 or in SAS EG 5.1 error comes up
ERROR in SAS 9.3: Libname ASIF is not assigned
ERROR in SAS EG 5.1: "you cannot create or delete datasets, views, or indexes in this mode. Try option MATAOUT=DATA. use proc metalib to create
metadata for datasets."
09-25-2012 04:08 PM
To enable SAS code to use the Management Console LIBNAME:
1) Check that the libname is visible in EG in the server list window and you can see any datasets in that library.
2) If yes to 1) then in Management Console under Data Library Manager pre-assign your library using the library native engine under the Advanced Options button in the Options tab of the library's properties.
By default a Management Console library can only be referenced in an EG task, not in SAS code. Hence the need to pre-assign it.