<?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 Opinions on EG best practices - code location and relative paths in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46296#M5245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I'll start by answering my own questions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Code location&lt;/P&gt;&lt;P&gt;At first we were embedding the code, but then I was offsite using my mac via remote desktop to run an unplanned fix to the code.&amp;nbsp; I found I couldn't get to the code b/c EG was not on our server.&amp;nbsp; After that we went to the practice of putting the code external so it was available in case we for some reason needed a way to run the code interactively (we are SAS programmers, not EG analysts so we are very comfortable with that).&amp;nbsp; Since then we've loaded a copy of EG on the server so now even from my mac with VPN and remote desktop, I can log in and run EG projects no problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My conclusion:&amp;nbsp; If you have EG available in all your environments, keeping the code inside the program is the way to go as it prevents things from getting lost when you migrate environments and reduces the chances of accidental deletion/editing/moving.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Relative paths&lt;/P&gt;&lt;P&gt;My conclusion:&amp;nbsp; Why wouldn't we - other than the chance you forget to migrate external files with it - and that is just making sure we have good attention to details.&amp;nbsp; Okay, easier said than done, but we should be able to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Nov 2011 16:54:42 GMT</pubDate>
    <dc:creator>JenHarper</dc:creator>
    <dc:date>2011-11-11T16:54:42Z</dc:date>
    <item>
      <title>Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46295#M5244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp; know that there will be opinions both ways on this, but I am curious to see what folks are thinking and why.&amp;nbsp; So, the two topics are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Thoughts about saving code within the EG project versus as shortcuts and saving the code as .sas outside the project&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Thoughts about using relative paths for pointing to external files - such as external code (if we go that way) or external data sets, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 16:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46295#M5244</guid>
      <dc:creator>JenHarper</dc:creator>
      <dc:date>2011-11-11T16:32:31Z</dc:date>
    </item>
    <item>
      <title>Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46296#M5245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I'll start by answering my own questions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Code location&lt;/P&gt;&lt;P&gt;At first we were embedding the code, but then I was offsite using my mac via remote desktop to run an unplanned fix to the code.&amp;nbsp; I found I couldn't get to the code b/c EG was not on our server.&amp;nbsp; After that we went to the practice of putting the code external so it was available in case we for some reason needed a way to run the code interactively (we are SAS programmers, not EG analysts so we are very comfortable with that).&amp;nbsp; Since then we've loaded a copy of EG on the server so now even from my mac with VPN and remote desktop, I can log in and run EG projects no problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My conclusion:&amp;nbsp; If you have EG available in all your environments, keeping the code inside the program is the way to go as it prevents things from getting lost when you migrate environments and reduces the chances of accidental deletion/editing/moving.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Relative paths&lt;/P&gt;&lt;P&gt;My conclusion:&amp;nbsp; Why wouldn't we - other than the chance you forget to migrate external files with it - and that is just making sure we have good attention to details.&amp;nbsp; Okay, easier said than done, but we should be able to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 16:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46296#M5245</guid>
      <dc:creator>JenHarper</dc:creator>
      <dc:date>2011-11-11T16:54:42Z</dc:date>
    </item>
    <item>
      <title>Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46297#M5246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need ultimate flexibility in how you run your SAS programs and from what location you run them from, then I suggest it is best to avoid relative paths. However it is common practice for us to set up a global macro variable to define our application path like so: %let appdir = &lt;A href="https://communities.sas.com/"&gt;\\ourappserver\appdir1\appdir2&lt;/A&gt;; We then cascade this definition throughout all SAS programs in the overall SAS application so it sort of acts like a relative path. Then it doesn't matter from where you run your SAS application: SAS server, any desktop etc the programs always reference directory locations correctly. And if you want to switch between Production / Test / Development environments you just need to change one macro variable and the application then is re-pointed to the new environment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 22:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46297#M5246</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2011-11-13T22:14:22Z</dc:date>
    </item>
    <item>
      <title>Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46298#M5247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the code location.&amp;nbsp; The best answer is "it depends".&amp;nbsp; If the code is to be used by multiple projects, then storing it outside EGuide makes maintenance easier.&amp;nbsp; If the code is project specific, then inside EGuide is fine.&amp;nbsp; Another consideration is the editor.&amp;nbsp; Like many who program a lot, I am rather fond of an editor other than the SAS provided one; if I want to use that editor, I need to keep the code outside of the EGuide project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[The EGuide editor has actually gotten pretty decent.&amp;nbsp; As I work in both the Unix and PC worlds, I prefer the consistency of EMACS.]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 15:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46298#M5247</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-11-14T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46299#M5248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Thoughts about saving code within the EG project versus as shortcuts and saving the code as .sas outside the project&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I save my codes externally as different .SAS files. And heavily use %include in the main .SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROS: I primarily used EG. But when I need to run on my desktop version of SAS for Windows, I can migrate it easily from EG. Sometimes our corporate SAS Server which is shared by many departments can be very slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONS: Without EG, there is no Link and it is not easy to visualize the link and order of codes: &lt;A href="http://freepicupload.com/images/909eg_flow.jpg"&gt;http://freepicupload.com/images/909eg_flow.jpg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This problem of visualizing the structure of the code will be gone after sometime when the user gets used to the project. For documentation, we draw a diagram of the code hierachy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Thoughts about using relative paths for pointing to external files - such as external code (if we go that way) or externa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As SASKiwi as replied, I use global variable to define the path and libraries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2011 08:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46299#M5248</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2011-11-15T08:35:28Z</dc:date>
    </item>
    <item>
      <title>Opinions on EG best practices - code location and relative paths</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46300#M5249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EG 4.3 added an under-advertised feature for relative paths.&amp;nbsp; You can store files such as SAS programs, and Excel and text files for import, in a folder relative to the EGP file, and when you move the whole collection around from machine to machine (or check in/out of a source management system) the files should all resolve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, enable it for your project with File-&amp;gt;Project-&amp;gt;Properties, select File References and the "Use relative paths" option:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="relative.png" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1311_relative.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can have a file structure like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Projects\MyProject.egp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; C:\Projects\programs\FirstToInclude.sas&lt;/P&gt;&lt;P&gt;&amp;nbsp; C:\Projects\programs\SecondToInclude.sas&lt;/P&gt;&lt;P&gt;&amp;nbsp; C:\Projects\data\ExcelToImport.xlsx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you add the SAS programs by reference (not embedded) and import the XLSX file, this entire folder structure becomes "portable" -- you can lift it and drop it on another folder, drive, or machine and all should resolve without having to fix in Tools-&amp;gt;Project Maintenance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you can make your code "relative folder aware" as well, using this tip:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2011/07/11/how-to-assign-a-library-to-the-same-path-as-your-sas-enterprise-guide-project/"&gt;http://blogs.sas.com/content/sasdummy/2011/07/11/how-to-assign-a-library-to-the-same-path-as-your-sas-enterprise-guide-project/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2011 20:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Opinions-on-EG-best-practices-code-location-and-relative-paths/m-p/46300#M5249</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2011-11-21T20:17:28Z</dc:date>
    </item>
  </channel>
</rss>

