BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

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

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisBrooks
Ammonite | Level 13

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

2 REPLIES 2
ChrisBrooks
Ammonite | Level 13

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

Patrick
Opal | Level 21

@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. 🙂 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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