BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
411752
Fluorite | Level 6

I have a requirement to update metadata from the Server information option in connections, this need to be switched back and froth due to maintenance , is there any code/automatic option for this , that I can schedule on the required time?

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
An authentication domain is an association instead of a property so you'd need to use METADATA_SETASSN to set the association to one authentication domain versus another. In this case you would need two URIs, the URI of the AuthDomain and that of the connection to associate.

The URI of the connection:
omsobj:SASClientConnection?SASClientConnection[Source/ServerComponent[@Name='Sybase IQ 1']]"

The URI of the AuthDomain:
omsobj:AuthenticationDomain?AuthenticationDomain[@Name='DefaultAuth']

You'd use the REPLACE mod for METADATA_SETASSN on the Domain association of the connection URI.

METADATA_SETASSN Function
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrmeta/p1pt2ddn2xhmaen1p5whdq58ithh.htm
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

7 REPLIES 7
gwootton
SAS Super FREQ
Yes, you could write code to modify a servers connection information in Metadata rather than editing the values manually in SAS Management Console if that's what you mean. I don't know that such code already exists. Can you be more specific about what it is you're trying to change?
--
Greg Wootton | Principal Systems Technical Support Engineer
411752
Fluorite | Level 6

@gwootton : Yes, thats the code I am looking for.

I wanted to change the database connection server information from below window under the Server Manager->Database servers->Connection ->options

411752_0-1685560159047.png

 

gwootton
SAS Super FREQ
That information (Host, Server, Port) for a Sybase IQ connection is held in Property objects associated with the connection. So for a server called "Sybase IQ 1", the URI for those properties would be:

obj="omsobj:Property?Property[@Name='Connection.DBMS.Property.SERVER.Name.xmlKey.txt'][AssociatedObject/SASClientConnection/Source/ServerComponent[@Name='Sybase IQ 1']]";
obj="omsobj:Property?Property[@Name='Connection.DBMS.Property.HOST.Name.xmlKey.txt'][AssociatedObject/SASClientConnection/Source/ServerComponent[@Name='Sybase IQ 1']]";
obj="omsobj:Property?Property[@Name='Connection.DBMS.Property.NPORT.Name.xmlKey.txt'][AssociatedObject/SASClientConnection/Source/ServerComponent[@Name='Sybase IQ 1']]";

You could use METADATA_SETATTR to update the DefaultValue attribute for these objects to change them.

METADATA_SETATTR Function
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrmeta/n0t9rzceun8o14n0zi8a1hfls9h7.htm
--
Greg Wootton | Principal Systems Technical Support Engineer
411752
Fluorite | Level 6

@gwootton : Thank you!. I have updated the 'Sybase IQ 1' to my server, host and port numbers and used metadata_getattr function but they are returning "-3" , is there any other steps, I need to take care to be able to find them?.

 

I see these entries in the PROP dataset from metadata server repository which are matching with the information I have updated.

gwootton
SAS Super FREQ
You would change "Sybase IQ 1" to the name of your Sybase server in Metadata for all three queries. You would not put the host or port there. This URI translates as the property called "Connection.DBMS..." that is associated with the connection that is associated with the server called "Sybase IQ 1".

A -3 means the URI does not return any results.
--
Greg Wootton | Principal Systems Technical Support Engineer
411752
Fluorite | Level 6

Thank you @gwootton : It worked for me. I also have Authdomain, can you also suggest the URI to use for AuthDomain update?.

gwootton
SAS Super FREQ
An authentication domain is an association instead of a property so you'd need to use METADATA_SETASSN to set the association to one authentication domain versus another. In this case you would need two URIs, the URI of the AuthDomain and that of the connection to associate.

The URI of the connection:
omsobj:SASClientConnection?SASClientConnection[Source/ServerComponent[@Name='Sybase IQ 1']]"

The URI of the AuthDomain:
omsobj:AuthenticationDomain?AuthenticationDomain[@Name='DefaultAuth']

You'd use the REPLACE mod for METADATA_SETASSN on the Domain association of the connection URI.

METADATA_SETASSN Function
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrmeta/p1pt2ddn2xhmaen1p5whdq58ithh.htm
--
Greg Wootton | Principal Systems Technical Support Engineer

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
  • 7 replies
  • 618 views
  • 2 likes
  • 2 in conversation