The SAS® programs provided in the Download tab identify clinical objects that require repair. A repair is required when "a clinical object is damaged" and covers these clinical objects:
The download tab has two SAS® programs that can be run against the Metadata Server for SAS® Clinical Data Integration 2.3 and above. Both programs use the SAS® Open Metadata Interface to query the server for problems and generate a report. The report contains the full path of the object so that it can be located more easily in SAS® Data Integration Studio. Users need to change the metadata options as noted in the programs.
Domaintemplatemetadatarepair.sas – finds domain templates that were copied between standards.
Note: These are not repairable, but running the repair tool against them removes old links to avoid metadata issues.
The SAS programs have been tested against SAS® Clinical Data Integration 2.3, 2.4, and 2.5.
For additional information about the Repair functionality in SAS® Clinical Data Integration:
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
**********************************************************************************;
* domainmetadatarepair.sas *;
* *;
* Program connects to the specified metadata server and seaches for domains *;
* that were copied & pasted (or exported/imported) from another study or *;
* submission. If domains are found, a report is generated that contains the *;
* path information so that users can find the objects in CDI and run the repair *;
* utility. *;
* *;
* Assumptions: *;
* The user changes the options below to specify the correct metadata server *;
* and uses and account with unrestricted access. *;
* *;
* Supported CDI Versions: 2.5, 2.4, 2.3 *;
**********************************************************************************;
/* submit connection information to server */
/* make sure that you use an unrestricted user account to run this program */
options metaport=8561
metaserver="SERVER.DOMAIN.COM"
metauser="sasadm@saspw"
metapass="{SAS002}A5222D554655B9EC38F4AC360C2FAE72"
metarepository="Foundation";
/* Assign filerefs and libref. */
filename query temp;
filename rawdata temp;
filename map temp;
libname myxml xml xmlfileref=rawdata xmlmap=map;
/* Create temporary query file. */
/* 2309 flag plus template gets table name, column name, */
/* engine, libref, and object IDs. The template specifies */
/* attributes of the nested objects. */
data _null_;
file query;
input;
put _infile_;
datalines;
$METAREPOSITORY
PhysicalTable
SAS
8576
;;
run;
proc metadata
in=query
out=rawdata;
run;
data _null_;
file map;
put '';
put '';
put '';
put '/GetMetadataObjects/Objects/PhysicalTable ';
put '';
put '/GetMetadataObjects/Type ';
put 'character ';
put 'string ';
put '13 ';
put ' ';
put '';
put '/GetMetadataObjects/Objects/PhysicalTable/@Id ';
put 'character ';
put 'string ';
put '17 ';
put ' ';
put '
';
put ' ';
run;
data work.table;
length uri $256;
set myxml.physicaltable;
uri=type || '/' || id;
run;
/* create the full path for each object found */
data work.tables (drop=rc arc n treeName);
set work.table;
length tableName treeName $256;
tableName="";
treeName="";
arc=0;
n=1;
rc=metadata_getattr(uri,"Name",tableName);
rc=metadata_getnasn(uri,
"Trees",
1,
uri);
if (rc>0) then arc=metadata_getattr(uri,"Name",treeName);
path=trim(treeName);
do while (rc>0);
rc=metadata_getnasn(uri,
"ParentTree",
1,
uri);
arc=metadata_getattr(uri,"Name",treeName);
if (rc>0) then path=trim(treeName) || "/" || trim(path);
end;
path="/" || path;
run;
%let dsid=%sysfunc(open(work.tables));
%let num=%sysfunc(attrn(&dsid,nobs));
%let rc=%sysfunc(close(&dsid));
proc print data=work.tables noobs label;
title "Domains Requiring Repair (Obs=&num)";
var tableName path;
label tableName="Table"
path="Metadata Folder";
run;
libname myxml;
filename rawdata;
filename query;
filename map;
**********************************************************************************;
* domaintemplatemetadatarepair.sas *;
* *;
* Program connects to the specified metadata server and seaches for domain *;
* templates that were copied & pasted (or exported/imported) from another *;
* standard. If domains are found, a report is generated that contains the *;
* path information so that users can find the objects in CDI and run the repair *;
* utility. Note that these objects are not repairable. The repair utility *;
* only removes metadata links to previous studies\submissions\standards. *;
* *;
* Assumptions: *;
* The user changes the options below to specify the correct metadata server *;
* and uses and account with unrestricted access. *;
* *;
* Supported CDI Versions: 2.5, 2.4, 2.3 *;
**********************************************************************************;
/* submit connection information to server */
/* make sure that you use an unrestricted user account to run this program */
options metaport=8561
metaserver="SERVER.DOMAIN.COM"
metauser="sasadm@saspw"
metapass="{SAS002}A5222D554655B9EC38F4AC360C2FAE72"
metarepository="Foundation";
/* Assign filerefs and libref. */
filename query temp;
filename rawdata temp;
filename map temp;
libname myxml xml xmlfileref=rawdata xmlmap=map;
/* Create temporary query file. */
/* 2309 flag plus template gets table name, column name, */
/* engine, libref, and object IDs. The template specifies */
/* attributes of the nested objects. */
data _null_;
file query;
input;
put _infile_;
datalines;
$METAREPOSITORY
PhysicalTable
SAS
8576
;;
run;
proc metadata
in=query
out=rawdata;
run;
data _null_;
file map;
put '';
put '';
put '';
put '/GetMetadataObjects/Objects/PhysicalTable ';
put '';
put '/GetMetadataObjects/Type ';
put 'character ';
put 'string ';
put '13 ';
put ' ';
put '';
put '/GetMetadataObjects/Objects/PhysicalTable/@Id ';
put 'character ';
put 'string ';
put '17 ';
put ' ';
put '
';
put ' ';
run;
data work.table;
length uri $256;
set myxml.physicaltable;
uri=type || '/' || id;
run;
/* create the full path for each object found */
data work.tables (drop=rc arc n treeName);
set work.table;
length tableName treeName $256;
tableName="";
treeName="";
arc=0;
n=1;
rc=metadata_getattr(uri,"Name",tableName);
rc=metadata_getnasn(uri,
"Trees",
1,
uri);
if (rc>0) then arc=metadata_getattr(uri,"Name",treeName);
path=trim(treeName);
do while (rc>0);
rc=metadata_getnasn(uri,
"ParentTree",
1,
uri);
arc=metadata_getattr(uri,"Name",treeName);
if (rc>0) then path=trim(treeName) || "/" || trim(path);
end;
path="/" || path;
run;
%let dsid=%sysfunc(open(work.tables));
%let num=%sysfunc(attrn(&dsid,nobs));
%let rc=%sysfunc(close(&dsid));
proc print data=work.tables noobs label;
title "Domains Templates Requiring Repair (Obs=&num)";
var tableName path;
label tableName="Table"
path="Metadata Folder";
run;
libname myxml;
filename rawdata;
filename query;
filename map;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2014-06-05 14:17:21 |
Date Created: | 2014-06-05 11:45:03 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Clinical Data Integration | Linux for x64 | 2.3 | 9.3 TS1M2 |