BookmarkSubscribeRSS Feed
pszabady
Fluorite | Level 6

I would like to be able to create new and/or edit existing objects using command line instead of SMC.  Can anyone point me to documentation that would help correlate SMC UI objects and their associated properties to something I can access from CLI?

 

For example, I had a need to reconfigure the WebDAV URL for about eight applications.  This required me to fire up SMC, click roughly 3 times to get to the top level (Environment Management → Foundation Services Manager).  The for each application, I had to click roughly 10 times and then enter the same 3 bits of information and then 3 "OKs".  That's over 100 clicks and other possibility of over 20 typos.  I would LOVE to be able to script something to query the existing values of these settings and then update if/as appropriate.

 

Thank you in advance!

 

5 REPLIES 5
alexal
SAS Employee

@pszabady,

 

You have to use SAS Management Console. SAS Management Console is the primary administrative interface for the SAS Intelligence Platform. In SAS Viya you can do a lot of tasks through CLI, but not SAS 9.x.

JackHamilton
Lapis Lazuli | Level 10
There are macros provided by SAS that can be used for userid maintenance. Not what you asked for, but you might be able to adapt the code in one of those macros to build a WebDAV maintenance macro. The second paper mentions bulk processing of libraries and OLAP schemas, so maybe WebDav definitions are also available.

http://support.sas.com/kb/40/628.html

https://analytics.ncsu.edu/sesug/2014/PSA-03.pdf


SASKiwi
PROC Star

If this is a once-only task, then doing your "click marathon" is still going to be faster than building a script to do it. Don't forget you need to test your script (even if it were possible but it sounds like it isn't) with the strong possibility you will corrupt your server metadata until you get it right.

PaulHomes
Rhodochrosite | Level 12

I don't have any suggestions for command-line but if you can find what you need to modify in metadata then you could potentially use the SAS 9.4 Open Metadata Interface from Base SAS, Java or .Net. An understanding of the SAS 9.4 Metadata Model is also required. As @SASKiwi mentions however there is potential for some serious damage so thorough testing in a throwaway playpen environment is highly recommended.

 

When I want to find potential metadata objects in this type of scenario I use our Metacoda Metadata Explorer Plug-in to search for something like 'dav' across all character attributes on all SAS model type objects and then when I find what I want I try to narrow the search into an XMLSELECT style query that I can use with the SAS metadata API to find the exact set of objects I want (and potentially update them).

 

Changing lots of Foundation Services DAV configs (after configuring HTTPS) is something that I have done in the past but I can't remember whether I used code to change them or just to review them to make sure I'd changed them correctly via point and click. I had a quick look to see if I had any old code for it but couldn't find anything so perhaps I decided point and click was quicker for a one-off job as @SASKiwi mentioned 😉

 

If you want to have a go, to update or just review manual changes, you may find the following 2 queries useful to get you started on where to look (the curly brackets indicate an XMLSELECT style query to the Metacoda Metadata Explorer plug-in - so remove those to use the XMLSELECT query in SAS Metadata API code):

 

1) This one finds Information Service XML configs used by Foundation Services containing WebDAV attributes:

 

{{{ TextStore[@TextRole='initialization' and @StoredText contains 'WebDAV'] }}}

2) This one finds a WebDAV mapping for the SAS Folders root folder.

 

{{{ Document[@URIType='DAV'] }}}
JuanS_OCS
Amethyst | Level 16

Hello @pszabady,

 

I think you can only do it, a this moment, via manual changes in SAS Management Console, as mentioned earlier.

In SAS 9.4, SAS developers have provided command-line actions to automate a lot, you can find this in the SASPlatformObjectFramework directory of your SASHome folder, and inside it, there are even more commands under tools and then under admin. 

 

Unfortunately, the bad news is that there is nothing about such things as the Foundation Services (this could be a good idea for the Ballot). Removing human error: always a great idea.

 

Yep, you can do something with the Interface language to the Metadata, but it is way delicate and dangerous, your SAS environment could be easily broken, because of all the many dependencies. A good example: maybe you can even make it work, but a software maintenance (migration, upgrade, or hotfix) might not read the changes appropiately, of they might conflict between themselves.

 

In any case, I probably won;t have to say it but: if you will try anything not documented by SAS, anything new:

1- have your say, play with it of course, and always in a good separate test environment, that won;t impact your users.

2- please share if you build something nice 🙂 Perhaps even worth a Paper to be presented in the Forums.

 

Hope it helps.

 

Kind regards,

Juan

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 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 3543 views
  • 3 likes
  • 6 in conversation