Hi,
I want to export the SAS EG project to a .sas file so that it can be run without depending on SAS EG. Additionally, I want to automate the exporting process of EG projects since I have hundreds of projects that need to be converted into .sas files."
EG itself can only export a project to a program file one at a time; AFAIK, there is no internal scripting for this available. You would need to dig into the automation facilities of Windows, if it can script the loading and exporting of a project through the user interface (by recording all keystrokes and mouse actions).
I have the code to do this. Will try and get it to github as a console app.
It will use .NET 8 if you are interested.
Thank you, could you please share
Will do once ready. I started work last night on making it accessible from the command line.
I will update this thread once ready (next week, hopefully).
Prelim version that does a bare minimum, for now. I left out the parsing and reporting for SAS code so you can accomplish the bare minimum (extract code):
I will add in the other bits over time. They are coded but in a different project. Let me know how it goes.
I also made it x64. .NET 5+ runs on all major platforms so the code could run as portable but I don't have another OS (outside of Windows) installed. If a need arises to support Linux, I can recompile and someone can test it.
Have a look at this 2017 article Doing More with SAS Enterprise Guide Automation by @ChrisHemedinger
It may have something you can use
@chandusaladi wrote:
Hi,
I want to export the SAS EG project to a .sas file so that it can be run without depending on SAS EG. Additionally, I want to automate the exporting process of EG projects since I have hundreds of projects that need to be converted into .sas files."
In an ideal world you would migrate these EG projects to Viya 4 SAS Studio Flow which are server side flow definitions that then also allow for server side scheduling.
Go with the flow; migrating Enterprise Guide Projects to SAS Studio Flows
The SAS EG projects are currently in version EG 6.1. Since we cannot directly migrate these projects to SAS Viya 4 (which supports only versions above EG 7.0), we have decided to convert them to .sas files and then proceed with the migration
@chandusaladi wrote:
The SAS EG projects are currently in version EG 6.1. Since we cannot directly migrate these projects to SAS Viya 4 (which supports only versions above EG 7.0), we have decided to convert them to .sas files and then proceed with the migration
There is an EG migration wizard that should make it a rather simple task to first migrate the project in bulk to EG7.x
If it was me then I'd consider a migration to Studio Flow preferable over an export to .sas files.
The more I'm getting into Studio Flow as part of my own learning journey the more I really start to like all the functionality and integration points it offers.
@chandusaladi - Doing a manual "Save As" in EG 8.3 to upgrade your projects to a migratable version would be pretty quick even with hundreds of projects.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.