<?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 Enterprise Guide, how to run program at startup in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489023#M31581</link>
    <description>&lt;P&gt;I'm a new EG user and every day&amp;nbsp;I'm finding things that irritate me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon starting EG I've got it set up to automatically connect to a remote server.&amp;nbsp; That works fine.&amp;nbsp; But I also have a second remote server that I sometimes connect to and sometimes I submit code to the local&amp;nbsp; 'server'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I (or can I) make it submit server-specific code (an autoexec.sas) the first time I connect to a server?&amp;nbsp; That is, when I set server&amp;nbsp;serverA as&amp;nbsp;'active' I want it to automatically run the serverA program&amp;nbsp;and when I set serverB active&amp;nbsp;I want the serverB program to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These programs contain server-specific options (like sasautos= ) and libname and filename&amp;nbsp;statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With my old PC SAS and SAS/Connect&amp;nbsp;it was pretty self-explanatory.&amp;nbsp; But with EG, the same Tools, Options, SAS Programs, 'submit SAS code when server is connected code' runs for every server.&amp;nbsp; I've tried putting an autoexec.sas in my home directory on each server but EG appears to ignore it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the program that's submitted to the servers when they're made active, I tried using a macro with conditional execution based on the value of _SASSERVERNAME to assign a global macro variable holding the server name.&amp;nbsp; But then checking it with a different&amp;nbsp;program using %put _user_; &amp;nbsp;doesn't show the global macro variable I tried to create&amp;nbsp;so I assume its not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ha anyone figured out how to do this?&amp;nbsp; Or is the answer to have a 'project' for each server and manually run it after connecting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
    <pubDate>Wed, 22 Aug 2018 19:47:35 GMT</pubDate>
    <dc:creator>bentleyj1</dc:creator>
    <dc:date>2018-08-22T19:47:35Z</dc:date>
    <item>
      <title>Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489023#M31581</link>
      <description>&lt;P&gt;I'm a new EG user and every day&amp;nbsp;I'm finding things that irritate me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon starting EG I've got it set up to automatically connect to a remote server.&amp;nbsp; That works fine.&amp;nbsp; But I also have a second remote server that I sometimes connect to and sometimes I submit code to the local&amp;nbsp; 'server'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I (or can I) make it submit server-specific code (an autoexec.sas) the first time I connect to a server?&amp;nbsp; That is, when I set server&amp;nbsp;serverA as&amp;nbsp;'active' I want it to automatically run the serverA program&amp;nbsp;and when I set serverB active&amp;nbsp;I want the serverB program to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These programs contain server-specific options (like sasautos= ) and libname and filename&amp;nbsp;statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With my old PC SAS and SAS/Connect&amp;nbsp;it was pretty self-explanatory.&amp;nbsp; But with EG, the same Tools, Options, SAS Programs, 'submit SAS code when server is connected code' runs for every server.&amp;nbsp; I've tried putting an autoexec.sas in my home directory on each server but EG appears to ignore it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the program that's submitted to the servers when they're made active, I tried using a macro with conditional execution based on the value of _SASSERVERNAME to assign a global macro variable holding the server name.&amp;nbsp; But then checking it with a different&amp;nbsp;program using %put _user_; &amp;nbsp;doesn't show the global macro variable I tried to create&amp;nbsp;so I assume its not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ha anyone figured out how to do this?&amp;nbsp; Or is the answer to have a 'project' for each server and manually run it after connecting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 19:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489023#M31581</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2018-08-22T19:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489272#M31592</link>
      <description>&lt;P&gt;Using _SASSERVERNAME as you described worked for me...&lt;/P&gt;
&lt;P&gt;(I used EG 7.15, but I'd expect it to work for any version.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-In EG's Tools-&amp;gt;Options-&amp;gt;SAS Programs, I checked "Submit SAS code when server is connected" and inserted this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;_SASSERVERNAME;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Then, after connecting to my workspace server ("SASApp" in my case), I checked the workspace server initialization log (right-click the server in the Servers view, select Properties, Software tab, then click View Initialization Log button).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the bottom of the log, it properly printed the _SASSERVERNAME...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;522 /* Insert custom code after server connection here */&lt;BR /&gt;523 %put &amp;amp;_SASSERVERNAME;%let _EG_WORKSPACEINIT=1;&lt;BR /&gt;'SASApp'&lt;BR /&gt;524&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you should be able to use _SASSERVERNAME in conditional logic in your custom workspace initialization code to submit different code for different servers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: If you wanted the same&amp;nbsp;code to be submitted &lt;U&gt;for all users&lt;/U&gt; (just different code for each server), I'd recommend adding it to different autoexec.sas files on the server and update the server definitions in metadata to use the different autoexecs.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 13:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489272#M31592</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2018-08-23T13:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489280#M31594</link>
      <description>&lt;P&gt;Thanks for your help Casey.&amp;nbsp; I'll give it another try.&amp;nbsp; I didn't know about the &lt;SPAN&gt;workspace server initialization log (right-click the server in the Servers view, select Properties, Software tab, then click View Initialization Log button).&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does&amp;nbsp; %let&lt;SPAN&gt;_EG_WORKSPACEINIT=1 do in your custom code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Modifying the autoexec.sas on the server and updating the server definitions to use different autoexecs is a great idea but it will never happen here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489280#M31594</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2018-08-23T14:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489492#M31595</link>
      <description>&lt;P&gt;John,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, the "&lt;SPAN&gt;%let&lt;/SPAN&gt;&lt;SPAN&gt;_EG_WORKSPACEINIT=1;&lt;/SPAN&gt;" is actually part of the EG-generated workspace initialization code, not my custom code.&amp;nbsp; It appears to be part of my custom code, because I did not enter a carriage-return/line-feed after my custom code.&amp;nbsp; If I do enter a CRLF after my custom code, then it appears like this in the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;522 /* Insert custom code after server connection here */&lt;BR /&gt;523 %put &amp;amp;_SASSERVERNAME;&lt;BR /&gt;'SASApp'&lt;BR /&gt;524 %let _EG_WORKSPACEINIT=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;SPAN&gt;_EG_WORKSPACEINIT macro is simply an internal flag EG uses to indicate/check that workspace initialization has taken place.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 05:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/489492#M31595</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2018-08-24T05:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/490473#M31628</link>
      <description>&lt;P&gt;I can't find&amp;nbsp;&lt;SPAN&gt;the workspace server initialization log (right-click the server in the Servers view, select Properties, Software tab, then click View Initialization Log button).&lt;/SPAN&gt;&amp;nbsp; It's possible likely that our SAS Admin has turned off initialization logging, or is it possible that the SAS Admin has disabled the run code at startup capability?&amp;nbsp; Something like that wouldn't surprise me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need are some macro variables and librefs assigned at startup so I don't have to assign them manually. &amp;nbsp; But I don't know that will work because my experience seems to be that macro variables and librefs assigned in one project are not available in another.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/490473#M31628</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2018-08-28T14:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide, how to run program at startup</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/490527#M31629</link>
      <description>&lt;P&gt;John,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your screenshot is showing the General tab.&amp;nbsp; Click the &lt;STRONG&gt;Software&lt;/STRONG&gt; tab and you should see the &lt;STRONG&gt;View Initialization Log&lt;/STRONG&gt; button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 15:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-how-to-run-program-at-startup/m-p/490527#M31629</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2018-08-28T15:51:20Z</dc:date>
    </item>
  </channel>
</rss>

