BookmarkSubscribeRSS Feed
Azeem112
Quartz | Level 8

Hi Everyone, I'm trying to add SMC users into a SMC group using the SAS code. code is below

 

 

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);

 

 

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

 

below are the data results of the above code

 

 

Table: investigators_1
memkeyid
A5GJ233F.AP0000CY

Table: investigator_group_1
grpkeyid
A5GJ233F.A500002R

Table: grpmems
memkeyid          | grpkeyid
A5GJ233F.AP0000CY | A5GJ233F.A500002R

 

 

With the above data , last update macro throws error. 

 

%mduchgl(change=updates);

ERROR: The symbolic reference for A5GJ233F.$A5GJ233F.AP0000CY did not resolve.

Any hint or help that what am I missing or is there any other approach for the AD sync users. 

Validation macro also validates successfully and work.mduchgverrors 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.

 

Thanks.

 

1 REPLY 1
Sajid01
Meteorite | Level 14

Hello
If you can post the  log perhaps somebody may be able to help.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 728 views
  • 0 likes
  • 2 in conversation