Desktop productivity for business analysts and programmers

Export EG code programmatically

Accepted Solution Solved
Reply
Respected Advisor
Posts: 3,823
Accepted Solution

Export EG code programmatically

[ Edited ]

Hi all,

 

I'm working on a task where I need to analyze SAS code programmatically. I've got already such code working for .sas files.

What I need is something which also works for EG projects. 

 

There is an EG 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.

 

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?

 

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.?

 

Any pointers or even a solution of how to achieve this?

 

I don't have a lot of VB or C# experience so if this is the path you're going to suggest then please provide me with as much guidance as you can.

 

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. 

 

Thanks,

Patrick


Accepted Solutions
Solution
‎04-17-2017 05:00 AM
Frequent Contributor
Posts: 117

Re: Export EG code programmatically

There's a good article on this link with an example using VB Script here which you can probably adapt to another language.

 

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 Smiley Happy

View solution in original post


All Replies
Solution
‎04-17-2017 05:00 AM
Frequent Contributor
Posts: 117

Re: Export EG code programmatically

There's a good article on this link with an example using VB Script here which you can probably adapt to another language.

 

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 Smiley Happy

Respected Advisor
Posts: 3,823

Re: Export EG code programmatically

[ Edited ]

@ChrisBrooks

Thanks a lot Chris. That's exactly the pointer I've been hoping for and already more than expected :-) 

 

Update:

The VBScript you've linked to was very close to what I was after and I was able to add the few tweaks I needed. :-) 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 244 views
  • 1 like
  • 2 in conversation