BookmarkSubscribeRSS Feed
ucvikas
Obsidian | Level 7

Dear experts,

 

I am using SAS 9.4 + SAS management consol 9.4 I have below specific questions.

 

1. How to create metadata libraries in batch mode . For example If my end user needs a library then I have to create that in SAS management consol manually , I want to do that by using some code where I just pass required details and its done , instead of point and click in management consol.

2. how to apply an ACT on other ACTs using batch mode ? I know of a batch tool "sas-set-metadata-access" but I am unable to use it to apply an ACT on another ACT. ( i used it to apply ACTs on metadata folders) .

 

5 REPLIES 5
SASKiwi
PROC Star

Interesting questions. I'm not aware of any way of creating a data source in SMC using a program. The problem is there are so many options with these that any programming interface would be very complicated. Also how would you know it works properly? You still have to manually test the definition to see if it works properly, in a SAS workspace session.

If you do want to set up globally-available data sources in code you could always put LIBNAME statements into a SAS App server AUTOEXEC program. 

 

Personally I don't find the point and click setup of data sources very onerous as it is not something you do every day. Doing it this way you do avoid littering your SAS jobs with LIBNAME statements that may not be consistent. 

angian
SAS Employee

This is an example how you can apply and ACT named SMC PUBLIC and SASUSERS Denied ACT on another ACT called SMC VA All Users POC1 ACT 

 

sas-set-metadata-access -profile Admin "/System/Security/Access Control Templates/SMC VA All Users POC1 ACT(ACT)" -addACT "SMC PUBLIC and SASUSERS Denied ACT"

ronan
Lapis Lazuli | Level 10

@ucvikas wrote:

Dear experts,

 

I am using SAS 9.4 + SAS management consol 9.4 I have below specific questions.

 

1. How to create metadata libraries in batch mode . For example If my end user needs a library then I have to create that in SAS management consol manually , I want to do that by using some code where I just pass required details and its done , instead of point and click in management consol.


This is called Registering a Library in the SAS metadata server. I am not aware of any handy code or API/pre-built tool to register a new Library. If you're not afraid of coding and maintaining OMI XML requests then you may try this example :

 

https://support.sas.com/documentation/cdl/en/omaref/59983/HTML/default/viewer.htm#addobj.htm

 

Registering a new library is tricky : to be actionable , the library must be assigned to a SAS server (Application Context like SASApp). Then , there is a uniqueness constraint in the metadata server that requires that 'Library names must be unique within a SAS Application Server' :

 

https://support.sas.com/documentation/cdl/en/bisag/64088/HTML/default/viewer.htm#a003139364.htm  (point no. 4)

 

Therefore, you must code some request& existence test routine to be run before trying to create a new library (the uniqueness rule applies mercilessly and generates orphans libraries objects named 'Copy Of <LIBRARY>').

 

In addition to this, the library once registered must be populated with tables (that means, references of tables)  which, fortunately can be done quite easily using Proc METALIB :

 

https://support.sas.com/documentation/cdl/en/lrmeta/67971/HTML/default/viewer.htm#p1cqb9ofazns8pn1by...

 

As other members have mentioned, another way to go would be to give access to your users team - ast least to some Data Steward among them - in order to perform the manual tasks themselves. The SMC is not the only tool to register a Library. 

 

Since you are using SAS 9.4 client/server, you might have SAS Environment Manager already deployed. This comes with a new Web console Admin (a handful of SMC plugins have been put on-line) called the EVM Admin ; the Library Module works exactly like the SMC Data Library Manager plug-in :

 

https://support.sas.com/documentation/cdl/en/evadmug/68379/HTML/default/p0rgl1rwibcrc3n1kxys3aa3n3b9...

 

 

The EVM Admin console can be accessed within the Web Environment Manager application or directly using this adress :

 

HTTP(s)://<sas root URL or MidTier Hostname):7980/SASEnvironmentMgrMidTier

 

The following permissions are required to register a new library :

 

  • access to capability : Management Console 9.4:/Plug-ins/Data Library Manager
  • SASApp server context authorization (through an ACT) : +RM,+WM

 

 

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2229 views
  • 6 likes
  • 5 in conversation