5
votes

I'm using SAS Enterprise Guide 4.1 and my projects consist of a lot of code. That code is organized in external .sas files, mainly because .egp files are binary and plain text .sas files work better with git.

Problem is that SAS EG 4.1 uses apsolute paths to reference an external .sas file, so moving the project to different PC breaks the references to the code files (unless the other PC uses the same directory structure).

Is there any way to force SAS EG 4.1 to use relative paths (seems that SAS EG 4.3 uses relative paths, but upgrade is not an option). If not, is there at least a smart way to easily move projects?

For now, every time I have to move the project I embed the code into the project (which breaks revision control). Alternative is to delete all the references from the project and re-add them (which is a lot of work).

2

2 Answers

4
votes

EGP files are just zip files, from my understanding. So you ought to have a couple of ways of solving this. The simplest to me seems to use git to version the files inside the zip file. So unzip the .egp file to a folder and version that folder. When you want to go back, zip the folder then change its name to .egp

There ought to be some way to modify the file that contains the paths in the .egp file after the fact, also, but I'm not sufficiently familiar with .egp files to be sure.

4
votes

So EGP files are just zip archives. Inside an archive there is a file named 'project.xml' which contains (sub)nodes like these:

<CodeTask>
  <IncludeWrapper>True</IncludeWrapper> 
  <Embedded>False</Embedded> 
  <LinkedOpenName>D:\some\path\to\program.sas</LinkedOpenName> 
</CodeTask>

This path seems to work only if it's apsolute. Relative path might work but I don't know relative to what to put it (relative to project path doesn't work).

But now I can write a simple script to go through this xml file after the project has been moved and update the paths (I keep .sas files in the same directory as .egp files, so this should not be a problem).