<?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 Export EG code programmatically in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350235#M23083</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on a task where I need to analyze SAS code programmatically. I've got already such code working for .sas files.&lt;/P&gt;
&lt;P&gt;What I need is something which also works for EG projects.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an EG&amp;nbsp;menu which allows to export all code in a project (File / Export / Export all Code in Project...) so what I'm thinking about is to export the EG project to a .sas file and then use my already existing analysis code on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way how I could call this export function programmatically and though extract code from potentially hundreds of EG projects in one go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using a local SAS9.4 instance under Win7 - but I'm flexible what to use. A non-SAS approach is also o.k.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any pointers or even a solution of how to achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have a lot of VB or C# experience so if this is the path&amp;nbsp;you're going to suggest then please provide me with as much guidance as you can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that the EG project is a zip archive and I wouldn't have a problem to extract code nodes which are in plain text. What's challenging are the EG task nodes like a library assignment. That's why I'm thinking I have somehow to call the built-in EG functionality for export to a .sas file as this will deal with the full EG object model for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Patrick&lt;/P&gt;</description>
    <pubDate>Sat, 15 Apr 2017 08:33:26 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-04-15T08:33:26Z</dc:date>
    <item>
      <title>Export EG code programmatically</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350235#M23083</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on a task where I need to analyze SAS code programmatically. I've got already such code working for .sas files.&lt;/P&gt;
&lt;P&gt;What I need is something which also works for EG projects.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an EG&amp;nbsp;menu which allows to export all code in a project (File / Export / Export all Code in Project...) so what I'm thinking about is to export the EG project to a .sas file and then use my already existing analysis code on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way how I could call this export function programmatically and though extract code from potentially hundreds of EG projects in one go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using a local SAS9.4 instance under Win7 - but I'm flexible what to use. A non-SAS approach is also o.k.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any pointers or even a solution of how to achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have a lot of VB or C# experience so if this is the path&amp;nbsp;you're going to suggest then please provide me with as much guidance as you can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that the EG project is a zip archive and I wouldn't have a problem to extract code nodes which are in plain text. What's challenging are the EG task nodes like a library assignment. That's why I'm thinking I have somehow to call the built-in EG functionality for export to a .sas file as this will deal with the full EG object model for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2017 08:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350235#M23083</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-04-15T08:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Export EG code programmatically</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350241#M23084</link>
      <description>&lt;P&gt;There's a good article&amp;nbsp;&lt;A href="http://www.sascommunity.org/wiki/Not_Just_for_Scheduling:_Doing_More_with_SAS_Enterprise_Guide_Automation" target="_self"&gt;on this link&lt;/A&gt;&amp;nbsp;with an example using VB Script&amp;nbsp;&lt;A href="http://support.sas.com/documentation/onlinedoc/guide/examples/SASGF2012/ExtractCodeAndLog.vbs.txt" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;which you can probably adapt to another language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never done this myself but I have used the automation model to programatically create EG projects - I suggest you read through the linked material, make a start and then re-post with specific questions if/when you run into any problems&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2017 10:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350241#M23084</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-04-15T10:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export EG code programmatically</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350329#M23085</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks a lot Chris. That's exactly the pointer I've been hoping for and already more than expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update:&lt;/P&gt;
&lt;P&gt;The VBScript you've linked to was very close to what I was after and I was able to add&amp;nbsp;the few tweaks I needed. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Apr 2017 03:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-EG-code-programmatically/m-p/350329#M23085</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-04-16T03:56:32Z</dc:date>
    </item>
  </channel>
</rss>

