/*Specify connection options. Use an unrestricted user ID.*/ options metaserver="WIN-16NDD1VN0L5.deft-sas.com" metaport=8561 metauser="sasadm@saspw" metapass="Password123"; /*Specify the directory for the extracted AD data (master tables).1 */ libname adir "C:\ADUserSync\ADIRextract"; /* Specify the directory for the extracted metadata (target tables).*/ libname meta "C:\ADUserSync\METAextract"; /* Specify the directory for the comparison output (change tables).*/ libname updates "C:\ADUserSync\METAupdates"; /* Extract identity information from AD (master).2 */ %let _EXTRACTONLY = ; %include "C:\ADUserSync\importad.sas"; /* Extract identity information from the metadata (target).*/ %mduextr(libref=meta); /* Compare AD (master) to metadata (target).3 */ %mducmp(master=adir, target=meta, change=updates); /* Validate the change tables.*/ %mduchgv(change=updates, target=meta, temp=work, errorsds=work.mduchgverrors); /* Load the changes into the metadata.4 %mduchglb(change=updates); */ %macro exec_mduchglb; %if (&MDUCHGV_ERRORS ^= 0) %then %do; %put ERROR: Validation errors detected by %nrstr(%mduchgv). Load not attempted.; %return; %end; %mduchglb(change=updates); %mend; %exec_mduchglb;