The script does not use classic SAS tabular data. It queries and modifies the Metadata Repository via specialized DATA Step functions (metadata_resolve, metadata_getnobj, metadata_setassn).
1 Code Block
OPTIONS
Explanation : Configuration of SAS 9 metadata server connection parameters (host, port, user, password, repository).
Explanation : DATA _NULL_ step containing the business logic: querying the metadata server to find the application server URI, searching for target libraries, and assignment loop (adding the 'DeployedComponents' association with 'metadata_setassn').
Copied!
data _null_;
length type id app_uri lib_uri $ 50;
call missing(of _character_);
/* Recherche du contexte serveur SASSTP */
appobj="omsobj:ServerContext? @Name='SASSTP'";
app_count=metadata_resolve(appobj,type,id);
if app_count <= 0 then do;
put "ERROR: No application server context found matching query " appobj;
stop;
end;
else do;
/* Récupération de l'URI du contexte */
rc=metadata_getnobj(appobj,1,app_uri);
/* Recherche des bibliothèques cibles */
libobj="omsobj:SASLibrary? ..."; /* Partie corrompue dans l'entrée originale */
lib_count=metadata_resolve(libobj,type,id);
if lib_count <= 0 then do;
put "ERROR: No libraries found matching query " libobj;
stop;
end;
else do n=1 to lib_count;
/* Boucle de mise à jour des métadonnées */
rc=metadata_getnobj(libobj,1,lib_uri);
rc=metadata_setassn(lib_uri,"DeployedComponents","Append",app_uri);
end;
end;
run;
1
DATA _null_;
2
LENGTH type id app_uri lib_uri $ 50;
3
call missing(of _character_);
4
5
/* Recherche du contexte serveur SASSTP */
6
appobj="omsobj:ServerContext? @Name='SASSTP'";
7
app_count=metadata_resolve(appobj,type,id);
8
9
IF app_count <= 0 THENDO;
10
put "ERROR: No application server context found matching query " appobj;
11
stop;
12
END;
13
ELSEDO;
14
/* Récupération de l'URI du contexte */
15
rc=metadata_getnobj(appobj,1,app_uri);
16
17
/* Recherche des bibliothèques cibles */
18
libobj="omsobj:SASLibrary? ..."; /* Partie corrompue dans l'entrée originale */
19
lib_count=metadata_resolve(libobj,type,id);
20
21
IF lib_count <= 0 THENDO;
22
put "ERROR: No libraries found matching query " libobj;
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: 16JUN2017
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.