Created
November 22, 2017 08:59
-
-
Save frayos/5213a8e129747db67cc7a478fe266a37 to your computer and use it in GitHub Desktop.
Get TCP IP Connection informations from SAS Metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************ | |
Author Adam Bullock | |
13Dec2013 | |
************************************************************/ | |
options | |
metaserver="localhost" | |
metaport=8561 | |
metauser="sasadm@saspw" | |
metapass="xxxxxxx"; | |
data tcpip; | |
keep name port host protocol service; | |
length port host protocol objid service uri name $255; | |
nobj=0; | |
n=1; | |
do while (nobj >= 0); | |
nobj=metadata_getnobj("omsobj:TCPIPConnection?@Name='Connection URI' or @Name='External URI'",n,uri); | |
if (nobj >= 0) then do; | |
rc=metadata_getattr(uri,"Name",name); | |
if trim(name)='Connection URI' then name="Internal URI"; | |
rc=metadata_getattr(uri,"CommunicationProtocol",protocol); | |
rc=metadata_getattr(uri,"HostName",host); | |
rc=metadata_getattr(uri,"Port",port); | |
rc=metadata_getattr(uri,"Service",service); | |
*call cats(protocol,'://',host,':',port,service); | |
put name protocol"://"host":"port service; | |
output; | |
end ; | |
n = n + 1; | |
end; | |
run; | |
proc sort data=tcpip out=sorted; | |
by service; | |
run; | |
proc print data=sorted; | |
var name protocol port host service; | |
title 'Internal and External Connections (except SASThemes)'; | |
title2 'Listed by Service'; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment