<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change Internal and External Connections via code? in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842136#M25441</link>
    <description>&lt;P&gt;Thanks for this&lt;/P&gt;
&lt;P&gt;I am looking for protocal, port and&amp;nbsp; hostname so what about the Host Name?&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 16:23:19 GMT</pubDate>
    <dc:creator>sathya66</dc:creator>
    <dc:date>2022-11-02T16:23:19Z</dc:date>
    <item>
      <title>Change Internal and External Connections via code?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842099#M25437</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am changing the infernal and external connections manually, is there a way we&amp;nbsp; can do it via code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/bicdc/9.4/bimtag/n1s9ty2ykoxyr5n1ikt28hcjwuuz.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/bicdc/9.4/bimtag/n1s9ty2ykoxyr5n1ikt28hcjwuuz.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 14:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842099#M25437</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2022-11-02T14:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Change Internal and External Connections via code?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842119#M25438</link>
      <description>&lt;P&gt;Yes, I wrote this program a while ago that updated the port/protocol for these, so it would find any with http/7980 and updated to https/8343, but you could update other attributes as well:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* ---------------------------------------- [ reset_protocol.sas ] ---------------------------------------- *
 * The purpose of this program is to locate web connection info defined in Metadata and update the protocol *
 * and port. 																								*
 * Author: Greg Wootton Date: 26SEP2019 																	*
 * Note: This is experimental. Use at your own risk. 														*
 * -------------------------------------------------------------------------------------------------------- */

/* Define macro variables for Metadata connection information and the protocols and ports that need changing.*/
%let metaserve=meta.demo.sas.com;
%let metaport=8561;
%let userid=sasadm@saspw;
%let pass=password;
%let oldprotocol='http';
%let newprotocol='https';
%let oldport='7980';
%let newport='8343';
/*End edit. */

/* Define Metadata connection information. */
options metaserver="&amp;amp;metaserve"
metaport=&amp;amp;metaport
metaprotocol='bridge'
metauser="&amp;amp;userid"
metapass="&amp;amp;pass"
metarepository='Foundation'
metaconnect='NONE'
;

/* Take an ad-hoc Metadata backup. */

PROC METAOPERATE ACTION=refresh options="&amp;lt;BACKUP COMMENT='METAOPERATE backup'/&amp;gt;" noautopause;
RUN;

/* Define a search that only returns objects defined with the old protocol and port. */

%let query="omsobj:TCPIPConnection?@CommunicationProtocol=&amp;amp;oldprotocol and @Port=&amp;amp;oldport";

/* For each, change the protocol to the new one. */

data _null_;
	length type id uri $ 50 ;
	call missing (of _character_);
	count=metadata_resolve(&amp;amp;query,type,id);
	put "NOTE: Found " count "connections to update.";
	if count &amp;gt; 0 then do n=1 to count;
		rc=metadata_getnobj(&amp;amp;query,n,uri);
		rc=metadata_setattr(uri,"CommunicationProtocol",&amp;amp;newprotocol);
		rc=metadata_setattr(uri,"Port",&amp;amp;newport);
	end;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2022 15:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842119#M25438</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-11-02T15:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change Internal and External Connections via code?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842136#M25441</link>
      <description>&lt;P&gt;Thanks for this&lt;/P&gt;
&lt;P&gt;I am looking for protocal, port and&amp;nbsp; hostname so what about the Host Name?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 16:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842136#M25441</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2022-11-02T16:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change Internal and External Connections via code?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842157#M25443</link>
      <description>The hostname attribute is "HostName" so you could similarly modify the query to look for your desired HostName and add a metadata_setattr call to update it.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;%let oldhost='old.example.com';&lt;BR /&gt;%let newhost='new.example.com';&lt;BR /&gt;...&lt;BR /&gt;%let query="omsobj:TCPIPConnection?@CommunicationProtocol=&amp;amp;oldprotocol and @Port=&amp;amp;oldport and @HostName=&amp;amp;oldhost";&lt;BR /&gt;...&lt;BR /&gt;rc=metadata_setattr(uri,"HostName",&amp;amp;newhost)</description>
      <pubDate>Wed, 02 Nov 2022 17:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Change-Internal-and-External-Connections-via-code/m-p/842157#M25443</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-11-02T17:26:19Z</dc:date>
    </item>
  </channel>
</rss>

