<?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: STP to determin user groups in Developers</title>
    <link>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57845#M3077</link>
    <description>the stp is actually in an information map. so the current executor of the stp-&amp;gt;information map -&amp;gt; web report is what I am looking for . I have done the same thing with PROC OLAP and in that case its enough to "just" write a connection string without any user credentials.&lt;BR /&gt;
but know I actually need it in the code to have a IF---ELSE and use the "correct" proc sql depending on the user group(s).&lt;BR /&gt;
&lt;BR /&gt;
it is not the groups yet but just the username:&lt;BR /&gt;
%let uid_var=corp\%sysfunc(scan(“&amp;amp;_METAUSER”,1,“@”)));&lt;BR /&gt;
WARNING: Apparent symbolic reference _METAUSER not resolved.</description>
    <pubDate>Wed, 27 Apr 2011 13:28:50 GMT</pubDate>
    <dc:creator>metalray</dc:creator>
    <dc:date>2011-04-27T13:28:50Z</dc:date>
    <item>
      <title>STP to determin user groups</title>
      <link>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57844#M3076</link>
      <description>Hi Guys,&lt;BR /&gt;
I want to build a SQL that goes to an Oracle View that is executed in various ways depending on the SAS user groups.&lt;BR /&gt;
Now, I found this piece of code that gets me all users names togehter with IDs and their groups. nice. but I only want to get the user groups of the user that is executing the STP (as part of a web report). could someone help because I am uncertain if in this case _metauser will do the trick or not.&lt;BR /&gt;
&lt;BR /&gt;
data users_grps;&lt;BR /&gt;
 length uri name group groupuri $256 id $20;&lt;BR /&gt;
&lt;BR /&gt;
       /* Initialize variables to missing. */&lt;BR /&gt;
   n=1;&lt;BR /&gt;
   uri='';&lt;BR /&gt;
   name='';&lt;BR /&gt;
   group='';&lt;BR /&gt;
   groupuri='';&lt;BR /&gt;
   id='';&lt;BR /&gt;
&lt;BR /&gt;
  *Determine how many person objects are defined.;&lt;BR /&gt;
   nobj=metadata_getnobj("omsobj:Person?@Id contains '.'",n,uri);&lt;BR /&gt;
   if nobj=0 then put 'No Persons available.';&lt;BR /&gt;
&lt;BR /&gt;
   else do while (nobj &amp;gt; 0);&lt;BR /&gt;
&lt;BR /&gt;
         /* Retrieve the current person's name. */&lt;BR /&gt;
      rc=metadata_getattr(uri, "Name", Name);&lt;BR /&gt;
&lt;BR /&gt;
     /* Get the group association information for the current person. */&lt;BR /&gt;
      a=1;&lt;BR /&gt;
      grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);&lt;BR /&gt;
&lt;BR /&gt;
         /* If this person does not belong to any groups, set their group */&lt;BR /&gt;
         /* variable to 'No groups' and output the name. */&lt;BR /&gt;
      if grpassn in (-3,-4) then do;&lt;BR /&gt;
         group="No groups";&lt;BR /&gt;
         output;&lt;BR /&gt;
      end;&lt;BR /&gt;
&lt;BR /&gt;
         /* If the person belongs to any groups, loop through the list */&lt;BR /&gt;
         /* and retrieve the name of each group, outputting each on a */&lt;BR /&gt;
         /* separate record. */&lt;BR /&gt;
      else do while (grpassn &amp;gt; 0);&lt;BR /&gt;
         rc2=metadata_getattr(groupuri, "Name", group);&lt;BR /&gt;
         a+1;&lt;BR /&gt;
         output;&lt;BR /&gt;
         grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);&lt;BR /&gt;
      end;&lt;BR /&gt;
&lt;BR /&gt;
         /* Retrieve the next person's information. */&lt;BR /&gt;
      n+1;&lt;BR /&gt;
      nobj=metadata_getnobj("omsobj:Person?@Id contains '.'",n,uri);&lt;BR /&gt;
   end;&lt;BR /&gt;
  keep name group;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 27 Apr 2011 13:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57844#M3076</guid>
      <dc:creator>metalray</dc:creator>
      <dc:date>2011-04-27T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: STP to determin user groups</title>
      <link>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57845#M3077</link>
      <description>the stp is actually in an information map. so the current executor of the stp-&amp;gt;information map -&amp;gt; web report is what I am looking for . I have done the same thing with PROC OLAP and in that case its enough to "just" write a connection string without any user credentials.&lt;BR /&gt;
but know I actually need it in the code to have a IF---ELSE and use the "correct" proc sql depending on the user group(s).&lt;BR /&gt;
&lt;BR /&gt;
it is not the groups yet but just the username:&lt;BR /&gt;
%let uid_var=corp\%sysfunc(scan(“&amp;amp;_METAUSER”,1,“@”)));&lt;BR /&gt;
WARNING: Apparent symbolic reference _METAUSER not resolved.</description>
      <pubDate>Wed, 27 Apr 2011 13:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57845#M3077</guid>
      <dc:creator>metalray</dc:creator>
      <dc:date>2011-04-27T13:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: STP to determin user groups</title>
      <link>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57846#M3078</link>
      <description>It would be great if I could use SAS.IdentityGroups in the STP.</description>
      <pubDate>Wed, 27 Apr 2011 15:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-to-determin-user-groups/m-p/57846#M3078</guid>
      <dc:creator>metalray</dc:creator>
      <dc:date>2011-04-27T15:30:42Z</dc:date>
    </item>
  </channel>
</rss>

