Explanation : Data Step querying metadata to list 'ServerComponent' objects, extract their attributes (names) and associated connections (ports, protocols) via loops and `metadata_*` functions.
Copied!
data servers;
length type id $ 17 server_uri conn_uri $ 50 server_name conn_name $ 256 conn_prot conn_port $ 5 conn_port_num 3;
/* ... labels et initialisation ... */
obj="omsobj:ServerComponent? @code_sas_json_prod_multi/get_number_column_names_de.json contains '.'";
server_cnt=metadata_resolve(obj,type,id);
if server_cnt > 0 then do n=1 to server_cnt;
/* Extraction des infos serveur et connexions */
rc=metadata_getnobj(obj,n,server_uri);
/* ... logique d'extraction des ports ... */
if conn_port_num ne 0 then output;
end;
else put "ERROR: No server definitions found in Metadata.";
run;
1
DATA servers;
2
LENGTH type id $ 17 server_uri conn_uri $ 50 server_name conn_name $ 256 conn_prot conn_port $ 5 conn_port_num 3;
ELSE put "ERROR: No server definitions found in Metadata.";
14
RUN;
3 Code Block
PROC SORT
Explanation : Sorting the resulting table by server name.
Copied!
proc sort data=servers;
by server_name;
run;
1
PROC SORTDATA=servers;
2
BY server_name;
3
RUN;
4 Code Block
PROC REPORT
Explanation : Generation of a report displaying the list of extracted servers and ports.
Copied!
proc report data=servers;
title "Port use defined in Metadata Server &metaserve";
run;
1
2
PROC REPORT
3
DATA=servers;
4
title "Port use defined in Metadata Server &metaserve";
5
RUN;
6
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Author: Greg Wootton Date: 15JAN2018
« Extracting ports and protocols directly from the Metadata Server is a vital step for auditing and securing a SAS 9 platform. This script transforms the logical view of your infrastructure into a concrete network traffic matrix, which is indispensable for configuring firewalls or diagnosing connectivity issues between various components like Workspace, Stored Process, and OLAP servers. »
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.