<?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: How to include a program multiple times in egp in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869765#M42744</link>
    <description>&lt;P&gt;Does this code you want to attach execute the same thing in each of your programs?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so I would do the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) create file "myScript.sas" and inside it do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro wrapperForMyScript();

/* Put your code here so it will be wrapped inside a macro */

%mend wrapperForMyScript; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) add an autoexec process calling %include (remember code is in macro now so it will compile)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1681473292292.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82685i56917FED7B2C3FF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1681473292292.png" alt="yabwon_0-1681473292292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3) add &lt;CODE class=" language-sas"&gt;%wrapperForMyScript()&lt;/CODE&gt;&amp;nbsp;inside your programs in places you want your code to be executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 11:58:37 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-04-14T11:58:37Z</dc:date>
    <item>
      <title>How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868417#M42720</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;we have written a piece of code in a programm that we would like to include in serveral processflows in our egp. We couldn't figure out how to do that and still be able to refine the code so that it is up to date everywhere it is included in the project.&lt;/P&gt;&lt;P&gt;Thanks for ypur help!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 08:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868417#M42720</guid>
      <dc:creator>Laura1890</dc:creator>
      <dc:date>2023-04-06T08:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868422#M42721</link>
      <description>&lt;P&gt;I guess EG works on Windows and connects to a server, in such case store file with the code on the machne, e.g. "/myCodes/code.sas" and in your EG project add code block with this line:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "/myCodes/code.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 09:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868422#M42721</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-06T09:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868562#M42723</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;... and Welcome to the community! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; What about keeping it as a separate (external) piece of code and include it in the individual processes?&lt;/P&gt;
&lt;P&gt;--FJa&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 06:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868562#M42723</guid>
      <dc:creator>fja</dc:creator>
      <dc:date>2023-04-07T06:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868724#M42728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441563"&gt;@Laura1890&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on how/where your EG execute the code. While EG can be installed on your personal Windows machine, it can execute code in the following modes&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Connecting to Local installation of SAS --&amp;gt; The code is executed from locally accessible location&lt;/LI&gt;
&lt;LI&gt;Connecting to Remote Server installation of SAS&amp;nbsp; --&amp;gt; The code has be stored on the Remote SAS server in order to be accessible and executed&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;In order to include the program multiple times in EG, Check the &lt;STRONG&gt;Tools&lt;/STRONG&gt; --&amp;gt; &lt;STRONG&gt;Options&lt;/STRONG&gt; --&amp;gt; &lt;STRONG&gt;SAS Programs&lt;/STRONG&gt;&lt;BR /&gt;There are "Additional SAS code" options&amp;nbsp; that might give what you are looking for&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Sat, 08 Apr 2023 23:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/868724#M42728</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-04-08T23:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869557#M42737</link>
      <description>&lt;P&gt;This is what we tried: we saved the code snipped as "programm.sas"-file but we can include it once in the process flow (so that the filepath is correct and the programm ist not "embedded" in the project). If we add it a second time the programm is only embedded and thus can not be changed properly.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 11:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869557#M42737</guid>
      <dc:creator>Laura1890</dc:creator>
      <dc:date>2023-04-13T11:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869580#M42738</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441563"&gt;@Laura1890&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about taking&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;approach?&lt;/P&gt;
&lt;P&gt;In every Process Flow, Add an embedded Program entry named "Call_External" (as an example) and have the following statement inside every embedded program&lt;/P&gt;
&lt;P&gt;%include "&amp;lt;SavedExternalProgramm.sas&amp;gt;";&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a thought, hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869580#M42738</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-04-13T14:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869707#M42739</link>
      <description>&lt;P&gt;Laura,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could I ask another piece of information, please? The piece of code, what does it take as input and what does it produce as output? I had a little play with EG and was asking myself, what kind of program could sensibly used several times in a flow. Perhaps its input data is altered during the flow.&lt;/P&gt;
&lt;P&gt;--fja&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869707#M42739</guid>
      <dc:creator>fja</dc:creator>
      <dc:date>2023-04-14T06:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869708#M42740</link>
      <description>&lt;P&gt;It only takes tables from the database as input and creates tables on our database as output.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869708#M42740</guid>
      <dc:creator>Laura1890</dc:creator>
      <dc:date>2023-04-14T06:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869709#M42741</link>
      <description>&lt;P&gt;I would like to share what we tried and worked so far:&lt;/P&gt;&lt;P&gt;You can include a new program to a process flow, save it and then change the filepath to the existing program (that is already included in another project flow in the same project). In order that the filepath still works with relative paths it is necessary to save the .egp-file using "save as"... and save as a new file. This sounds weird to me, but worked so far.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869709#M42741</guid>
      <dc:creator>Laura1890</dc:creator>
      <dc:date>2023-04-14T06:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869744#M42742</link>
      <description>&lt;P&gt;So it is to be included in the same Project but in different flows ... but &lt;STRONG&gt;per flow&lt;/STRONG&gt; only once?&lt;/P&gt;
&lt;P&gt;--fja&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869744#M42742</guid>
      <dc:creator>fja</dc:creator>
      <dc:date>2023-04-14T11:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869750#M42743</link>
      <description>&lt;P&gt;Yes, maybe this helps with the project setup:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Laura1890_0-1681472335940.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82684i020ECB4CFD08B4B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Laura1890_0-1681472335940.png" alt="Laura1890_0-1681472335940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The programs 2/3/4/5 in Flow 2 and Flow 5 refer all to the (respectively) same .sas-file&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869750#M42743</guid>
      <dc:creator>Laura1890</dc:creator>
      <dc:date>2023-04-14T11:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869765#M42744</link>
      <description>&lt;P&gt;Does this code you want to attach execute the same thing in each of your programs?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so I would do the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) create file "myScript.sas" and inside it do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro wrapperForMyScript();

/* Put your code here so it will be wrapped inside a macro */

%mend wrapperForMyScript; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) add an autoexec process calling %include (remember code is in macro now so it will compile)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1681473292292.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82685i56917FED7B2C3FF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1681473292292.png" alt="yabwon_0-1681473292292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3) add &lt;CODE class=" language-sas"&gt;%wrapperForMyScript()&lt;/CODE&gt;&amp;nbsp;inside your programs in places you want your code to be executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869765#M42744</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-14T11:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a program multiple times in egp</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869767#M42745</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441563"&gt;@Laura1890&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;You can include a new program to a process flow, save it and then change the filepath to the existing program (that is already included in another project flow in the same project).&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I could not reproduce that on EG 8.2. It complained, that the file was already referenced by the project ...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So EG does obviously try to prevent you from including a program mutliple times in a project. One could possibly&amp;nbsp; trick EG by using OS links but then I would rather go for the %include method already mentioned in the first post by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;--fja&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 12:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-include-a-program-multiple-times-in-egp/m-p/869767#M42745</guid>
      <dc:creator>fja</dc:creator>
      <dc:date>2023-04-14T12:24:33Z</dc:date>
    </item>
  </channel>
</rss>

