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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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