<?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: Using custom Autoexec at startup of SAS EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989068#M46501</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39715"&gt;@thesasuser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Was thinking of a custom autoexec for each team.&lt;BR /&gt;Using the "Automatically run the Autoexec process flow" is not a feasible option.&amp;nbsp;&lt;BR /&gt;Similarly "insert custom code before" is also not a feasible option.&lt;BR /&gt;&lt;STRONG&gt;Wondering if there is some way to use a custom autoexec instead of the Autoexec in SAS Root.&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The two options you label as "not a feasible option" are described in this video:&lt;BR /&gt;SAS Tip: Automatic Code Execution with SAS Enterprise Guide&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=OzFYNw7Bntg" target="_blank"&gt;https://www.youtube.com/watch?v=OzFYNw7Bntg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would still select the “Submit SAS code when server is connected” - option (for Initialization Code).&lt;BR /&gt;But in the pop-up window ... you put code that executes conditionally (by means of a macro that you define and call).&lt;BR /&gt;Based on the user ID (automatic macro variable "sysuserid"), you determine which team a user belongs to. Then you use a %INCLUDE to load the autoexec file for that team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamA_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamB_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamC_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2026 15:46:53 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2026-06-02T15:46:53Z</dc:date>
    <item>
      <title>Using custom Autoexec at startup of SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989041#M46498</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;We are running SAS EG on the Desktop and SAS on a remote server running Windows OS.&lt;BR /&gt;The moment a user connect to the server it executes and Autoexec.sas&amp;nbsp; (and Autoexec_usermod.sas specified in it) in the [SASRoot]. &lt;STRONG&gt;The same Autoexec.sas (and the autoexec_usermod) executes for different teams with different teams&lt;/STRONG&gt;.&lt;BR /&gt;Was thinking of a custom autoexec for each team.&lt;BR /&gt;Using the "Automatically run the Autoexec process flow" is not a feasible option.&amp;nbsp;&lt;BR /&gt;Similarly "insert custom code before" is also not a feasible option.&lt;BR /&gt;&lt;STRONG&gt;Wondering if there is some way to use a custom autoexec instead of the Autoexec in SAS Root.&lt;/STRONG&gt;&lt;BR /&gt;I have already looked at the following and could not find something relevant for my case (or have I missed it?)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/td-p/489023" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/td-p/489023&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2014/05/01/autoexecs-the-sas-enterprise-guide-advantage/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2014/05/01/autoexecs-the-sas-enterprise-guide-advantage/&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is highly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2026 12:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989041#M46498</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2026-06-02T12:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using custom Autoexec at startup of SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989044#M46499</link>
      <description>&lt;P&gt;There are probably many ways of doing this, so it may come down to your requirements.&lt;/P&gt;
&lt;P&gt;How many teams are there that need separate autoexec?&lt;/P&gt;
&lt;P&gt;First, I don't think you should bypass the existing set up with the central ones.&lt;/P&gt;
&lt;P&gt;The different option within EG will distribute the logic from the server. This will be question of governance.&lt;/P&gt;
&lt;P&gt;On the server you could create separate compute contexts (e.g. other SASApp's). This a quite a change and feasible if you don't too many groupings and want other separation between you user groups.&lt;/P&gt;
&lt;P&gt;Maybe you could have a %include code in your central autoexec (with some kind of logic that pickup users group and select the appropriate .sas file), or %if %then %else sections in your autoexec code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2026 14:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989044#M46499</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2026-06-02T14:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using custom Autoexec at startup of SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989045#M46500</link>
      <description>&lt;P&gt;I'm not an admin, but I think if you want a different autoexec for each team, you would need to set up a different (logical?) SAS server for each team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way you can approach this is to create a utility macro %setup(teamname)&amp;nbsp; which each program would call at the beginning.&amp;nbsp; (Or could be called automatically when EG connects to the server).&amp;nbsp; I tend to use the %setup() approach as I like to see my code in the program and log, rather than depend on an autoexec.&amp;nbsp; Also as a user, I can maintain the definition of %setup() but typically can't muck with autoexecs.&amp;nbsp; This also tends to make code more portable when it is run on different servers (as DI job, stored process, or whatever).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2026 14:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989045#M46500</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2026-06-02T14:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using custom Autoexec at startup of SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989068#M46501</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39715"&gt;@thesasuser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Was thinking of a custom autoexec for each team.&lt;BR /&gt;Using the "Automatically run the Autoexec process flow" is not a feasible option.&amp;nbsp;&lt;BR /&gt;Similarly "insert custom code before" is also not a feasible option.&lt;BR /&gt;&lt;STRONG&gt;Wondering if there is some way to use a custom autoexec instead of the Autoexec in SAS Root.&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The two options you label as "not a feasible option" are described in this video:&lt;BR /&gt;SAS Tip: Automatic Code Execution with SAS Enterprise Guide&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=OzFYNw7Bntg" target="_blank"&gt;https://www.youtube.com/watch?v=OzFYNw7Bntg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would still select the “Submit SAS code when server is connected” - option (for Initialization Code).&lt;BR /&gt;But in the pop-up window ... you put code that executes conditionally (by means of a macro that you define and call).&lt;BR /&gt;Based on the user ID (automatic macro variable "sysuserid"), you determine which team a user belongs to. Then you use a %INCLUDE to load the autoexec file for that team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamA_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamB_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;%INCLUDE "\\fileserver\teams\teamC_autoexec.sas" / source2 ;&lt;/LI&gt;
&lt;LI&gt;...&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2026 15:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-custom-Autoexec-at-startup-of-SAS-EG/m-p/989068#M46501</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2026-06-02T15:46:53Z</dc:date>
    </item>
  </channel>
</rss>

