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

Hello!

 

I work in SAS EG on virtual machine. My EG project contains about 100 SAS programs which are located in different folders (they are not embedded to project). In order to make backup of programs linked to the project I embed them. In order to embed program I right click on it, go to ‘Properties’, and click ‘Embed’ button. I have to repeat these actions 100 times in order to embed all programs.

 

My question: is there some way to embed many programs to EG project at once?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Well, it could be made to work with EG Automation.  You can use EG Automation to create a new project, create a new code node with content, and then save the project.

 

So your process would use VBScript or PowerShell or similar, and would do the following:

  • Create an instance of the EG Automation app
  • Create a new project
  • Use native scripting methods to navigate the file system and for each SAS file:
    • create a new code node in the CodeCollection
    • read the content of the SAS file (using scripting file objects)
  • Then, when complete with all files, save the Project file

More details and examples about automation are in this article.

And in this blog post.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

3 REPLIES 3
ChrisHemedinger
Community Manager

Well, it could be made to work with EG Automation.  You can use EG Automation to create a new project, create a new code node with content, and then save the project.

 

So your process would use VBScript or PowerShell or similar, and would do the following:

  • Create an instance of the EG Automation app
  • Create a new project
  • Use native scripting methods to navigate the file system and for each SAS file:
    • create a new code node in the CodeCollection
    • read the content of the SAS file (using scripting file objects)
  • Then, when complete with all files, save the Project file

More details and examples about automation are in this article.

And in this blog post.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
SASKiwi
PROC Star

An alternative to your backup approach would be to use a version control tool with your EG programs. You can easily define what programs make up projects within the VC tool and it means embedding the programs into a project is not required. We use this approach and we never lose a program!

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
  • 3 replies
  • 6163 views
  • 6 likes
  • 4 in conversation