<?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: switch autoexec depending on the group to which the user belongs in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519052#M3711</link>
    <description>&lt;P&gt;Pre-assigned libraries will only work if you use the correct metadata connection, and a server context in metadata that the libraries are assigned to.&lt;/P&gt;
&lt;P&gt;[SAS configuration]/Lev1/SASApp/BatchServer/sasbatch.bat does that on its own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What environment variables are you setting? Wouldn't it be easier to just retrieve a user's group information in the autoexec_usermods.sas?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 08:28:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-12-06T08:28:55Z</dc:date>
    <item>
      <title>switch autoexec depending on the group to which the user belongs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519038#M3710</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to set environment variables using&amp;nbsp;SAS/config/Lev1/SASApp/appservercontext_env_usermods.bat depending on specific group that logon user belongs to.&lt;/P&gt;&lt;P&gt;I tried to get which groups current user belongs to from metadata as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create GetUserGroup.sas program that export user and group information from metadata using&amp;nbsp;%mduextr macro, and create a &lt;SPAN&gt;Get&lt;/SPAN&gt;&lt;SPAN&gt;UserGroup.bat&lt;/SPAN&gt;&amp;nbsp;that kicks &lt;SPAN&gt;Get&lt;/SPAN&gt;&lt;SPAN&gt;UserGroup.sas&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;2. Call&amp;nbsp;&lt;SPAN&gt;Get&lt;/SPAN&gt;&lt;SPAN&gt;UserGroup.bat in&amp;nbsp;appservercontext_env_usermods.bat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Add if~else statement in&amp;nbsp;appservercontext_env_usermods.bat to switch values that is set to environment variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GetUserGroup.bat works properly by itself. In appservercontext_env_usermods.bat "if~else" statement also works properly.&lt;BR /&gt;But call GetUserGroup.bat in appservercontext_env_usermods.bat and EG start up workspace server,somehow pre-assined libraries are missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if anyone has any idea please advise me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thankyou&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 07:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519038#M3710</guid>
      <dc:creator>AsakoOkano</dc:creator>
      <dc:date>2018-12-06T07:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: switch autoexec depending on the group to which the user belongs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519052#M3711</link>
      <description>&lt;P&gt;Pre-assigned libraries will only work if you use the correct metadata connection, and a server context in metadata that the libraries are assigned to.&lt;/P&gt;
&lt;P&gt;[SAS configuration]/Lev1/SASApp/BatchServer/sasbatch.bat does that on its own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What environment variables are you setting? Wouldn't it be easier to just retrieve a user's group information in the autoexec_usermods.sas?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 08:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519052#M3711</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-06T08:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: switch autoexec depending on the group to which the user belongs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519064#M3713</link>
      <description>&lt;P&gt;Do you really need system environment variables, or could global macro values be used to accomplish the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If group memberships change not to often, you could create a sas-file per user with the necessary %global-statements and include those in autoexec_usermods.sas with the statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "/path/&amp;amp;SysUserId..sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/switch-autoexec-depending-on-the-group-to-which-the-user-belongs/m-p/519064#M3713</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-12-06T09:44:55Z</dc:date>
    </item>
  </channel>
</rss>

