I am aware of the how to delete the users manually from SAS Management Console but can anyone tell me how to delete users from SAS Management Console using script/code in SAS EG.
Any response would be welcome
After using %mduextr, copy the resulting library (meta) to a new location, remove the users to delete, and use this as the master in the following steps.
Look at the sample programs for synchronization of users and groups with SAS metadata (see my answer to your previous question).
Use the "extract part" to get the current metadata, remove the unwanted users, and then run the sync process against the reduced userbase.
Or simply do it by synchronizing with your external userbase, if you have such (UNIX passwd/group or some LDAP source).
I am not an admin but doing this on adhoc basic
do I need to use the MDUCMP (MASTER=libref, TARGET=libref, CHANGE=libref, EXCEPTIONS=<libref.>dataset , <EXTERNONLY=0|1>, <AUTHDOMCOMPARE=name|keyid>) for update?
/* 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);
After using %mduextr, copy the resulting library (meta) to a new location, remove the users to delete, and use this as the master in the following steps.
Hi @Kurt_Bremser ,
sorry to ask in this thread, i am unable to raise new thread,
i need to do the clean up on SAS SMC for users: userid,name,display name.description options in SAS SMC.
how do i copy the resulting library (meta) to a new location
Actually i am running below code in SAS EG and iam getting error as "ERROR: Libname META is not assigned."
%mduextr(libref=meta);
would you please suggest how can i copy to new location and them modify and then update the data directly in SAS SMC please
What it says: the library is not assigned. You need a library to which the macro writes the data extracted from the metadata.
I want to clean up the userid,displayname,jobid and email fields.
So i got below code from you on SAS site please.
So iam trying to understand the code.
here library
adir = i am giving myown work path
updates = i am giving my own work path
So i run below macro in eg and it got extracted into work library using mduextr .
thanks @Kurt.Iam ver new to SAS Admin please.sorry to trouble you with simple things,
even though myimportad.sas is present in include path,
it is telling WARNING: Physical file does not exist.
Iam sorry for my poor communication.
Basically iam trying below code to do clean up and given my own directory for adir ,updates library
and iam not able to get "Extract identity information from AD (".
Request to please point me in right direction please.
Given your as yet limited knowledge of SAS coding, I would strongly advise you against any attempts at programmatically changing SAS metadata. I started to use (and adapt) the SAS-supplied importpw program when I was a quite accomplished (so they say) SAS coder and admin (with >10 years of SAS experience), and I tested and used it BEFORE I ever went live with our first metadata-driven SAS setup (9.1.3). The risk of doing something fatal to your SAS installation, from which you can't recover on your own, is simply too big. Get help from a local SAS consultant, and watch what he/she does, and have every step explained to you.
Specifically, I will not try to assist you here; I don't want to be even remotely responsible for the ensuing disaster.
Hi
I am actually trying the option which you have shared last year to delete the user accounts through the SAS script using defined macros.
1. I have extracted the metadata (library say ABC) and copied the resultant metadata library to another library (library say XYZ)
2. I have tried deleting the user in Person table in library XYZ first and sync back by taking XYZ as master. But after running the macro %mducmp, I do not see any updates in change library person tables
Could you pls advise, is this correct approach to remove users using script ?
Thank you.
Regards
Kiran
Study the log, there might be a clue why the deletion did not take place.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.