Hi,
Is there a way through which I can create users on SAS console through a script/code using a csv.
So i have list of around 500 users in an excel, and the task is to create the list of users for them to access SAS studio. Being a rookie on SAS, i just know one way to add users i.e. adding manually through SASMC and doing it for all 500 users.
I found this macro %MDUIMPC for importing users (http://support.sas.com/documentation/cdl/en/bisecag/63082/HTML/default/viewer.htm#p03uv2agudmy9cn1kn...) in SAS. As i understand this method creates tables in SAS environment which can then be used for creating users.
As of now I am stuck on the part where its asking to import a csv version of users.
Here I wanted to understand if there is any specific format required for the csv of users.
Alternately, if anyone knows any other way the please share.
Thanks,
Anuj
Hello @anujsri,
you are walking on the right path. The key for you is that you need to convert that information on CSV into the Canonical tables, that are refered in the documentation (the same you refer to, just a few paragraphs earlier).
Once you have the info in form of SAS cannonical tables and you have clear what is your field to be used as keyId (primary key), SAS will extract the info from SAS metadata again in form of canonical tables, then will compare both tables, and then the macros will create a third version of canonical tables, that will have update, add and delete versions, for the diffs. And if this is clear, the last macro will actually run the update in the SAS metadata, taking the info from this last version with update, add and delete.
Have a look at SASHome/SASFoundation/9.4/samples/base/importpw.sas. This is the program for synchronizing a UNIX userbase (/etc/passwd and /etc/group files) with SAS metadata. In essence, you have to build the same tables that the first part of the program creates from the UNIX files, so you can then use them in the following compare and update steps.
Thanks Kurt,
I will try out this sample code.
For the csv with user information, is there a specific format or any specific columns required for SAS to consume the information?
Thanks again,
Anuj
From the passwd and group files, I extract:
These are sufficient to populate the required fields for the sync.
User's full name, office and other information (title, phone number) is pulled from the gecos field in the passwd file.
For in-depth information, you can find the macro codes in SASHome/SASFoundation/9.4/sasautos.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.
Find more tutorials on the SAS Users YouTube channel.