BookmarkSubscribeRSS Feed
suncawy
Obsidian | Level 7

I have a SAS EG project with multiple process flows and there are multiple sas programs that are not embedded in the flows.  However, the location of the programs has recently changed.   Is there a quick way to change all of the programs path instead of doing them one by one ?

Here is an example of the path that I'm changing:

suncawy_0-1613502395621.png

 

2 REPLIES 2
PhilC
Rhodochrosite | Level 12

A retrospective thought after posting this message.  Sorry I use EG locally, so this applies if one's files are accessible to local file system.  So this may not apply to you.  I do wish you luck.

 

The best I can say is that you'll need to put your files back in place so that they are correctly referenced by the project again.  Then you can go into the project's properties and set the File References option "Use Paths relative to the project for programs...".  The next key step is to save the project.  (I know because of experience.)  Then you should be able to move the files and re-reference the files you wish. 

 

Not saying the each "mode", off or on, isn't useful.  What I wish I could say is that this information was always saved so that it could be changed retrospectively, by choice, if the files being moved around could not be avoided and perhaps it would be very time intensive to move things back.  

AlanC
Barite | Level 11

SAS egp files are actually zips of XML data. Read in the egp using a zip library, replace the instances in the XML of the old path, zip, save back as egp files. Test it on a few programs.

 

This stuff is best done in another language. I prefer C# but use whatever you want (python, for example). For an experienced developer this is ~1 hour of work. 

 

You could treat the XML as a string and use a regex to do the replace or use an XML engine.

 

So, in order:

 

1. Read egp files with a zip library

2. Change XML nodes where path needs replacement. OR, read in whole file as a string and replace the path using regex/string replace function

3. Save file back as an egp using a zip library

 

HTH,

Alan

 

https://github.com/savian-net

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3236 views
  • 0 likes
  • 3 in conversation