<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649912#M18969</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp; it is working..&lt;/P&gt;&lt;P&gt;i took the backup and tested for single record and i can see that for roles 'SAS admintsrator's' and DI Deveopers for my name came to description filed as 'SASAdministrators,DI Developers'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i need to display under description filed in customised format please..&lt;/P&gt;&lt;P&gt;for example if role in (SAS admintsrator's' and DI Deveopers) then description should be 'SAS Administrator'&amp;nbsp;&lt;/P&gt;&lt;P&gt;if role in (DI Deveopers) then Description should be S'AS Developer '&lt;/P&gt;&lt;P&gt;Actually i am having set of roles for which i need to create customised the description values based on roles for users.&lt;/P&gt;&lt;P&gt;Would you please guide on this please and i thank you so much for your help on this please&lt;/P&gt;</description>
    <pubDate>Fri, 22 May 2020 14:17:22 GMT</pubDate>
    <dc:creator>JJP1</dc:creator>
    <dc:date>2020-05-22T14:17:22Z</dc:date>
    <item>
      <title>Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649559#M18957</link>
      <description>&lt;P&gt;how to update the name column in GROUPMEMPERSONS_INFO SAS dataset by removing the existing data in SAS SMC application only SAS users and not for groups&lt;BR /&gt;i would need to do this with data step functions and not with import SAS macros please.&lt;BR /&gt;please guide.&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 13:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649559#M18957</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-21T13:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649566#M18958</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The GROUPMEMPERSONS_INFO dataset is a normal dataset created by the &lt;A href="https://go.documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n024i4nqa5b12qn1lfek77h69ns5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;%MDUEXTR User Import Macro&lt;/A&gt;&amp;nbsp;that contains a list of group objects members that are users. Are you saying you just want the users from that table (i.e. remove Id and Name columns) or a list of all users in Metadata (contents of the PERSON dataset).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to remove the id and name columns from GROUPMEMPERSONS_INFO with a SAS DATA step you could do this, creating a new dataset "groupper" removing those variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data groupper;&lt;BR /&gt;set groupmempersons_info;&lt;BR /&gt;drop id name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 13:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649566#M18958</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-21T13:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649574#M18959</link>
      <description>&lt;P&gt;NO...please.sorry for miscommunication&lt;/P&gt;&lt;P&gt;I need to update the SAS metadata i mean SAS user when it is registered in SMC, the description filed will be there right ? that info i need to remove existing description and add decription for every user based on some conditions using groups &amp;amp; roles that are defined for each user.&lt;/P&gt;&lt;P&gt;for example if user is having SAS Administrator ruler then description should be updated as SAS Admin..like this please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i can see groups &amp;amp; roles are under showing name column in&amp;nbsp;GROUPMEMPERSONS_INFO dataset file.&lt;/P&gt;&lt;P&gt;So i can see description column in person.person_info datasets .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please note that it is not normat data step. i need help on data step metadata functions to do this job please and not using importad.sas program pleaase&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 14:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649574#M18959</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-21T14:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649595#M18960</link>
      <description>&lt;P&gt;The Metadata DATA Step Function &lt;A href="https://go.documentation.sas.com/?docsetId=lrmeta&amp;amp;docsetTarget=n0t9rzceun8o14n0zi8a1hfls9h7.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;metadata_setattr&lt;/A&gt; would be used to specify the description attribute for a person object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you'd probably want to pull the current description first with &lt;A href="https://go.documentation.sas.com/?docsetId=lrmeta&amp;amp;docsetTarget=p1kjy5liyi86w8n1vfopazyeb70u.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;metadata_getattr&lt;/A&gt; and then append the next group name found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend taking an &lt;A href="https://go.documentation.sas.com/?docsetId=bisag&amp;amp;docsetTarget=p0zbk8iitgb98kn16sk4d0b8pkpv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p0wias65cuusgrn15o25zqw3cdtr" target="_self"&gt;ad-hoc metadata backup&lt;/A&gt; prior to testing any code that writes to metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, something like this would remove the description for any user who had one in the person table from Metadata in the first data step, then create a description that is a comma separated list of groups they are a member of from groupmempersons_info in the second data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Remove the existing description from any user with one in Person table except sasadm/sasevs/sastrust. */
data _null_;
	set work.person;
	if name = "sasadm" or name = "sasevs" or name = "sastrust" then put "Account is sasadm, sasevs or sastrust, skipping.";
	else do;
		if description ne "" then do;
			obj="omsobj:Person?@Name='"||name||"'";
			rc=metadata_setattr(obj,"Desc","");
		end;
	end;
run;

/* Add groups from groupmempersons_info to user's description for any user except sasadm/sasevs/sastrust */
data _null_;
	set work.groupmempersons_info;
	length desc $255;
	call missing (desc);
	if memName = "sasadm" or memname = "sasevs" or memname = "sastrust" then put "Account is sasadm, sasevs or sastrust, skipping.";
	else do;
		obj="omsobj:Person?@Name='"||memName||"'";
		rc=metadata_getattr(obj,"Desc",desc);
		if desc ne "" then desc=cats(desc,", ",Name);
		else desc=Name;
		rc=metadata_setattr(obj,"Desc",desc);
	end;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 14:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649595#M18960</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-21T14:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649912#M18969</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp; it is working..&lt;/P&gt;&lt;P&gt;i took the backup and tested for single record and i can see that for roles 'SAS admintsrator's' and DI Deveopers for my name came to description filed as 'SASAdministrators,DI Developers'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i need to display under description filed in customised format please..&lt;/P&gt;&lt;P&gt;for example if role in (SAS admintsrator's' and DI Deveopers) then description should be 'SAS Administrator'&amp;nbsp;&lt;/P&gt;&lt;P&gt;if role in (DI Deveopers) then Description should be S'AS Developer '&lt;/P&gt;&lt;P&gt;Actually i am having set of roles for which i need to create customised the description values based on roles for users.&lt;/P&gt;&lt;P&gt;Would you please guide on this please and i thank you so much for your help on this please&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 14:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649912#M18969</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-22T14:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649920#M18970</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;You can certainly expand upon the logic to set a description based on the contents of the "Name" field instead of adding it directly as the description as I did using whatever rules you want to apply as if statements. The program I provided demonstrates how to set the description. Note that DATA step functions run for each line in the data set, so you'd need to account for a member who is in groups that match more than one of your rules.</description>
      <pubDate>Fri, 22 May 2020 14:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/649920#M18970</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-22T14:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650601#M18985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;iam trying below code for one record to test if group is SASAdministartor then Desc should be SAS Adminstartors.&lt;/P&gt;&lt;P&gt;But in SAS EG code it runs fine with out errors but i can not see the changes as expected in SMC&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	set work.groupmempersons_info(where=(memid='XXXXXX'));
	length desc $255;
	call missing (desc);
	if memName = "sasadm" or memname = "sasevs" or memname = "sastrust" then put "Account is sasadm, sasevs or sastrust, skipping.";
	else if Name='SAS Administrators' then desc='SAS Administrators';
		rc=metadata_setattr(obj,"Desc",desc);
	
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 May 2020 06:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650601#M18985</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-26T06:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650917#M19003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The name of the SAS Adminstrators group is "SASAdministrators" (no space). Does removing the space apply the description as expected?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 20:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650917#M19003</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-26T20:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650988#M19005</link>
      <description>&lt;P&gt;No.it's not getting update please . i tried by removing the space also&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 06:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/650988#M19005</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-27T06:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651031#M19007</link>
      <description>Where in your DATA step have you defined what "obj" is?</description>
      <pubDate>Wed, 27 May 2020 10:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651031#M19007</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-27T10:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651208#M19010</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78975"&gt;@gwootton&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;iam trying below code to remove existing description but it is not working and reflecting in SMC actually retirn code =-3 getting . please help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	set work.Person(where=(keyid='XXXX'));
	if name = "sasadm" or name = "sasevs" or name = "sastrust" then put "Account is sasadm, sasevs or sastrust, skipping.";
	else do;
		if description ne "" then do;
			obj="omsobj:Person?@Name='"||name||"'";
			rc=metadata_setattr(obj,"Desc","");
		end;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Note : iam using correct keyid value. please help&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 06:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651208#M19010</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-28T06:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651352#M19012</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;sorry to bother. any help on this please.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 11:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651352#M19012</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2020-05-28T11:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Update name column in GROUPMEMPERSONS_INFO SAS dataset using data step metadata function</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651367#M19013</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;A return code of -3 to the &lt;A href="https://documentation.sas.com/?docsetId=lrmeta&amp;amp;docsetTarget=n0t9rzceun8o14n0zi8a1hfls9h7.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;METADATA_SETATTR&lt;/A&gt; function means the object you are querying does not exist in Metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran your code and it was successful and the description "new description" was removed in SMC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;35   data _null_;
36       set work.Person(where=(keyid='A5KPQZKO.AP000007'));
37       put _all_;
38       if name = "sasadm" or name = "sasevs" or name = "sastrust" then put "Account is sasadm,
38 ! sasevs or sastrust, skipping.";
39       else do;
40           if description ne "" then do;
41               obj="omsobj:Person?@Name='"||name||"'";
42               rc=metadata_setattr(obj,"Desc","");
43               put rc=;
44           end;
45       end;
46   run;

keyid=A5KPQZKO.AP000007 name=grwoot description=new description title=  displayname=Greg Wootton
objid=A5KPQZKO.AP000007 externalkey=0 obj=  rc=. _ERROR_=0 _N_=1
rc=0
NOTE: There were 1 observations read from the data set WORK.PERSON.
      WHERE keyid='A5KPQZKO.AP000007';
NOTE: DATA statement used (Total process time):
      real time           0.12 seconds
      cpu time            0.03 seconds
&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2020 13:19:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Update-name-column-in-GROUPMEMPERSONS-INFO-SAS-dataset-using/m-p/651367#M19013</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2020-05-28T13:19:34Z</dc:date>
    </item>
  </channel>
</rss>

