<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding a user in a group of SAS metadata via Code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-user-in-a-group-of-SAS-metadata-via-Code/m-p/729543#M227043</link>
    <description>&lt;P&gt;Hi Everyone, I'm trying to add SMC users into a SMC group using the SAS code. code is below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname current '/saswork/tmp/tmp1';   /* for the current metadata */

libname addgrps '/saswork/tmp/tmp2';  /* current augmented with the changes */

libname updates '/saswork/tmp/tmp3';  /* for the updates created by the mducmp macro */


options metaserver=metaServerHostname

        metaport=8561

        metauser='sasadm@saspw'

        metapass='Password'

        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 ('ps02692019');
rename objid = memkeyid;
keep objid;
run;


data investigator_group_1;
set current.group_info;
where name='GCM Users';
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);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works fine with all of the users that we created from SMC (both internal and external accounts) but this code throws error for those users that are created by ADSync script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below are the data results of the above code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Table: investigators_1
memkeyid
A5GJ233F.AP0000CY

Table: investigator_group_1
grpkeyid
A5GJ233F.A500002R

Table: grpmems
memkeyid          | grpkeyid
A5GJ233F.AP0000CY | A5GJ233F.A500002R&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the above data , last update macro&amp;nbsp;throws&amp;nbsp;error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;%mduchgl(change=updates);&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;ERROR: The symbolic reference for A5GJ233F.$A5GJ233F.AP0000CY did not resolve.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Any hint or help that what am I missing or is there any other approach for the AD sync users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Validation macro also validates successfully and&amp;nbsp;&lt;CODE class=" language-sas"&gt;work.mduchgverrors&lt;/CODE&gt;&amp;nbsp;show no rows as it's error free, but while applying changes, the above error occurs. no idea why it duplicated the first part of user objid and throws error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Mar 2021 10:41:37 GMT</pubDate>
    <dc:creator>Azeem112</dc:creator>
    <dc:date>2021-03-27T10:41:37Z</dc:date>
    <item>
      <title>Adding a user in a group of SAS metadata via Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-user-in-a-group-of-SAS-metadata-via-Code/m-p/729543#M227043</link>
      <description>&lt;P&gt;Hi Everyone, I'm trying to add SMC users into a SMC group using the SAS code. code is below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname current '/saswork/tmp/tmp1';   /* for the current metadata */

libname addgrps '/saswork/tmp/tmp2';  /* current augmented with the changes */

libname updates '/saswork/tmp/tmp3';  /* for the updates created by the mducmp macro */


options metaserver=metaServerHostname

        metaport=8561

        metauser='sasadm@saspw'

        metapass='Password'

        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 ('ps02692019');
rename objid = memkeyid;
keep objid;
run;


data investigator_group_1;
set current.group_info;
where name='GCM Users';
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);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works fine with all of the users that we created from SMC (both internal and external accounts) but this code throws error for those users that are created by ADSync script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below are the data results of the above code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Table: investigators_1
memkeyid
A5GJ233F.AP0000CY

Table: investigator_group_1
grpkeyid
A5GJ233F.A500002R

Table: grpmems
memkeyid          | grpkeyid
A5GJ233F.AP0000CY | A5GJ233F.A500002R&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the above data , last update macro&amp;nbsp;throws&amp;nbsp;error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;%mduchgl(change=updates);&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;ERROR: The symbolic reference for A5GJ233F.$A5GJ233F.AP0000CY did not resolve.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Any hint or help that what am I missing or is there any other approach for the AD sync users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Validation macro also validates successfully and&amp;nbsp;&lt;CODE class=" language-sas"&gt;work.mduchgverrors&lt;/CODE&gt;&amp;nbsp;show no rows as it's error free, but while applying changes, the above error occurs. no idea why it duplicated the first part of user objid and throws error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 10:41:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-user-in-a-group-of-SAS-metadata-via-Code/m-p/729543#M227043</guid>
      <dc:creator>Azeem112</dc:creator>
      <dc:date>2021-03-27T10:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a user in a group of SAS metadata via Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-user-in-a-group-of-SAS-metadata-via-Code/m-p/730662#M227547</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;If you can post the&amp;nbsp; log perhaps somebody may be able to help.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 12:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-user-in-a-group-of-SAS-metadata-via-Code/m-p/730662#M227547</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-04-01T12:35:36Z</dc:date>
    </item>
  </channel>
</rss>

