SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

SAS Management Console & User Tracking

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

SAS Management Console & User Tracking

Hi,

I am new with SAS SMC 9.1. I had created new user in SAS SMC 9.1.

Now, I need a report which contain list of user created from SAS SMC 9.1.

It is like user tracking list. Can I get this kind of report from SAS SMC 9.1?

Thank you.

Regards,

Senico


Accepted Solutions
Solution
‎04-30-2012 06:34 AM
SAS Employee
Posts: 7

Re: SAS Management Console & User Tracking

Hey,

You could use a datastep to retrieve the users registered in the metadata e.g. :

/* example */

/* connect to metadataserver */

options metaserver=""                   /* specify metadataserver */  

metaport=8561                             /* metadata server port */

metauser=""                                 /* user id : e.g. SAS Administrator --> sasadm */

metapass=""                   /* user password          */

metarepository="Foundation"

metaprotocol=BRIDGE;

/* retrieve list of users */

data _null_;
  length uri $256 user $100;
  nobj=1;
  n=1;
  do while(nobj >= 0);
  nobj=metadata_getnobj("omsobjSmiley Tongueerson?@Id contains '.'",n,uri);
      if (nobj < 0) then leave;
      arc=metadata_getattr(uri,"Name",user);
     put n= user=;
     n=n+1;
  end;
run;

/* end example */

If you want to create a list containing groups change Person by IdentityGroup.

If you want to create a list containing both groups and users change Person by Identity.

Instead of writing the user information to the log you can write it to a dataset. You can use this dataset to create reports.

Besides retrieving the name of the users you can extract extra information from the metadata such as when the user was created. To know this you would retrieve information about the inherited attibute "MetadataCreated" (http://support.sas.com/documentation/cdl/en/omamodref/61849/HTML/default/viewer.htm#person.htm ) e.g.

arc=metadata_getattr(uri,"MetadataCreated",MC);

FYI : SAS ® 9.1.3 Open Metadata Interface : http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_ref_10177.pdf

Regards,

Bago

View solution in original post


All Replies
Solution
‎04-30-2012 06:34 AM
SAS Employee
Posts: 7

Re: SAS Management Console & User Tracking

Hey,

You could use a datastep to retrieve the users registered in the metadata e.g. :

/* example */

/* connect to metadataserver */

options metaserver=""                   /* specify metadataserver */  

metaport=8561                             /* metadata server port */

metauser=""                                 /* user id : e.g. SAS Administrator --> sasadm */

metapass=""                   /* user password          */

metarepository="Foundation"

metaprotocol=BRIDGE;

/* retrieve list of users */

data _null_;
  length uri $256 user $100;
  nobj=1;
  n=1;
  do while(nobj >= 0);
  nobj=metadata_getnobj("omsobjSmiley Tongueerson?@Id contains '.'",n,uri);
      if (nobj < 0) then leave;
      arc=metadata_getattr(uri,"Name",user);
     put n= user=;
     n=n+1;
  end;
run;

/* end example */

If you want to create a list containing groups change Person by IdentityGroup.

If you want to create a list containing both groups and users change Person by Identity.

Instead of writing the user information to the log you can write it to a dataset. You can use this dataset to create reports.

Besides retrieving the name of the users you can extract extra information from the metadata such as when the user was created. To know this you would retrieve information about the inherited attibute "MetadataCreated" (http://support.sas.com/documentation/cdl/en/omamodref/61849/HTML/default/viewer.htm#person.htm ) e.g.

arc=metadata_getattr(uri,"MetadataCreated",MC);

FYI : SAS ® 9.1.3 Open Metadata Interface : http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_ref_10177.pdf

Regards,

Bago

Occasional Contributor
Posts: 9

Re: SAS Management Console & User Tracking

Thanks Bago.

Your answer is really useful.

Thanks again.


Senior User
Posts: 1

Re: SAS Management Console & User Tracking

Hi I was trying to get SAS Users list and run the above mentioned code. I got the following message:

 NOTE: Variable uri is uninitialized.
NOTE: Variable user is uninitialized.

Do i need to do some modification in the code other than the specifications to be provided in options.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 966 views
  • 0 likes
  • 3 in conversation