将元用户添加到sas中的元组

将元用户添加到sas中的元组,sas,sas-macro,sas-metadata,Sas,Sas Macro,Sas Metadata,我在SAS 9.4平台的SAS EGRC 6.1中拥有大约600个元用户 我想将这些用户添加到元组中。为此,我使用下面的代码 libname current '/tmp/temp1'; /* for the current metadata */ libname addgrps '/tmp/temp2'; /* current augmented with the changes */ libname updates '/tmp/temp3'; /* for the updates

我在SAS 9.4平台的SAS EGRC 6.1中拥有大约600个元用户

我想将这些用户添加到元组中。为此,我使用下面的代码

libname current '/tmp/temp1';   /* for the current metadata */

libname addgrps '/tmp/temp2';  /* current augmented with the changes */

libname updates '/tmp/temp3';  /* for the updates created by the mducmp macro */


options metaserver=abc

        metaport=8561

        metauser='sasadm@saspw'

        metapass='xyz123'

        metaprotocol=bridge

        metarepository=foundation;


%mduextr(libref=current);


proc copy in = current out = addgrps;
/*copy the current data to the directory for the target */
run;

data investigators_1;
set current.person;
where name in ('5806036');
rename objid = memkeyid;
keep objid;
run;


data investigator_group_1;
set current.group_info;
where name='Enterprise GRC: Incident Investigation';
rename id = grpkeyid;
keep id;
run;


proc sql;
create table grpmems as
select * from investigators_1, investigator_group_1;
quit;


proc append base = addgrps.grpmems data = grpmems;
run;


/* use the mducmp macro to create the updates data */
%mducmp(master=addgrps, target=current, change=updates)

/* validate the change data sets */
%mduchgv(change=updates, target=current, temp=work, errorsds=work.mduchgverrors)

/* apply the updates */
%mduchgl(change=updates);
对于最终更新,我尝试了%mduchgl和%mduchglb,但两者都无法获得所需的结果。我用一个用户测试它

使用%mduchgl,我得到以下错误

The symbolic reference for A52PDIUF.$A52PDIUF.AP0000NI did not resolve.
使用%mduchglb,我得到以下错误

The object reference to Person was requested without an identifier.
Errors returned from Proc Metadata prevented objects from being Added, Updated, or Deleted.  Table: work.mduchglb_failedobjs 
identifies 1 such objects.  Consult the SAS Log for the specific Metadata Server errors returned.
任何关于如何解决错误的建议,或我应该尝试实现这一目标的其他方法


谢谢。

我认为你永远不应该修改那些数据集!使用
proc metadata
(或数据步骤功能作为最后手段),您需要实现的一切都应该是可能的

这里是一个相关的SAS社区。总结—以下代码段将向用户添加组,只要您具有组/用户URI:

<Person Id="A5NUQPXO.AP00002V">
  <IdentityGroups>
    <IdentityGroup ObjRef="A5NUQPXO.A500001C" />
  </IdentityGroups>
</Person>

更新-为了完整起见,我将其转换为一个宏,如下所述


PROC METADATA metaserver=“server”metaport=8561 metauser=”sasadm@saspw“metapass=”xxxxx“协议=网桥in=”;跑这也是我试图做的,但如果出现“例程名称person无效”的错误,则需要使用
updateMetadata
方法: