BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom2021
Fluorite | Level 6

Now we have solution from Allan to add user to groups; But, we want advice or sample code to create a new user in code like %macro meta_create_user(testuserFN testuserLN, login=testuser1). the user will be added in DefaultAuth.

I ran sample code from metadata import and bulkload as below. But, i found the new user account has blank at authdomain. it should be DefaultAuth.

We tested the program to add it into a group but failed; even if we setup external identify on the group. it seems the bulkload is to load all external accounts into metadata but the objects cannot have same names inside metadata repository.

thx

 

 


/* purpose: create a new user with
name=testfirst0 testlast0,
loginid=testuser0 in DefaultAuth,
do not touch group
*/


/* Initialize the macro variables that create canonical tables. */
%mduimpc();

/* Create the person table. */
data &persontbla ;
%definepersoncols;
infile datalines delimiter=',' missover;
input keyid name description title;
datalines;
testuser0,testfirst0 testlast0,,
;

/* Create the phone table. */
data &phonetbla ;
%definephonecols;
infile datalines delimiter=',' missover;
input keyid phoneNumber phoneType;
datalines;
testuser0,,
;

/* Create the location table. */
data &locationtbla ;
%definelocationcols;
infile datalines delimiter=',' missover;
input keyid locationName locationType address city postalcode area
country;
datalines;
testuser0,,,,,,,
;

/* Create the email table. */
data &emailtbla ;
%defineemailcols;
infile datalines delimiter=',' missover;
input keyid emailAddr emailtype;
datalines;
testuser0,,
;

/* Create the idgrp table. */
data &idgrptbla ;
%defineidgrpcols;
infile datalines delimiter=',' missover;
input keyid name description grpType;
datalines;
;

/* Create the grpmems table. */
data &idgrpmemstbla;
%defineidgrpmemscols;
infile datalines delimiter=',' missover;
input grpkeyid memkeyid;
datalines;
;

/* Create the authdomain table. */
data &authdomtbla;
%defineauthdomcols;
infile datalines delimiter=',' missover;
input keyid authDomName;
datalines;
A001,DefaultAuth
;

/* Create the logins table. */
data &logintbla;
%definelogincols;
infile datalines delimiter=',' missover;
input keyid userid password authdomkeyid;
datalines;
testuser0,testuser0,,A001
;

/* Load the information from the work library into the metadata server. */
%mduimplb();

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 15 replies
  • 4243 views
  • 1 like
  • 5 in conversation