SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
colonel4
Calcite | Level 5

Hi,

Is there a sas command to call an egp file from a sas program? I tried %include but it returned an error.

5 REPLIES 5
SASKiwi
PROC Star

No. EGPs need to be run from Enterprise Guide, not in a separate SAS session even if it is started from EG. EGPs can be called from VB or Powershell scripts as these set up the required EG environment to run in. 

Kurt_Bremser
Super User

Just for the technical background: a .egp file is a zip archive of XML files which describe the contents of the project.

%INCLUDE expects pure text, so you can't use it for .egp files.

If the project contains nothing that needs EG's special capabilities (file transfer, local interaction with MS Office and other such stuff), then you can export the whole project as code, transfer that to the server (if you use one), and use %INCLUDE there.

colonel4
Calcite | Level 5

Thank you @Kurt_Bremser. I was hoping to import an external excel file on SAS EG by creating an egp project. My objective was calling it it from a code so I don't have to upload the file manually each time. I saw in one of your previous posts that it was possible by Data>Copy files. I created two steps by adding copy files and a proc import in the project. But seemingly there is no way to automate the file importing process.

Quentin
Super User

While I use EG (happily), I avoid using the non-code features.  In this case if you need to upload an Excel file to the server before reading it, I would look for other options for automating the file upload.  For example, our SAS server is running on linux.  We have used SMB to let us easily push files from windows to the server.    And we can schedule a job on Windows to push files.  We've also sometimes mounted windows shares to linux so that we can have SAS jobs running on the server that pull files stored on Windows.  So we can schedule a job on linux to pull files and then batch submit a SAS job.  Or the SAS program itself can pull the files, or read the files in place.  

 

If you rely on EG non-code features, then you're relying on EG to run the programs, and you need to look into ways to automating calls to EG (see Chris Hemedinger's papers/blogs/etc.)  If you use pure SAS code, then your code can run as a batch job, or in EG, or as a stored process, or whatever.  And it can always be supplemented with some OS scripting if needed.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
AlanC
Barite | Level 11

Not every aspect of non-code EG can be automated via code. Normally, you automate tasks using C# and the EG .NET libraries. However, this seems like overkill here. You can automate every aspect of EG using an RPA technology. For example, Power Automate is built into Windows (free) and can replicate everything you do in EG.

 

Simplest solution: write a SAS program, as Quentin mentioned, and automate that. If you want a new super skill, look at RPA.

 

https://github.com/savian-net

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 5 replies
  • 2767 views
  • 7 likes
  • 5 in conversation