03-30-2015 08:13 AM
I've two similar SAS programs but they seem to have somo differences between them. Since it is long program it will be little difficult to do a manual comparison.
So how this can be achieved in SAS EG like we do a code comparison in text editor like Ultra Edit?
03-30-2015 08:29 AM
Seems like your best option will be to save the programs as .sas files and use an external tool like ultraedit (or diff on UNIX) to do the compare.
03-30-2015 08:46 AM
From this blog post from Chris H., EG 7.1 includes the ability to diff files, as one part of real version control it introduces (via GIT). So looks to me like you are in luck (I'm not on 7.1 yet, so haven't tested. Guess I'm not in luck. : )
03-30-2015 09:35 AM
There is also information about the ability to compare programs in the SAS Enterprise Guide 7.1 help. This ability is part of the new program history feature. You can use your program history to compare two different committed versions of a program, and you can compare a committed version of the program to the code that is currently in the program editor.
In the table of contents, expand "Working with Programs" and then "Understanding program history", or search for "program history".
03-30-2015 10:16 AM
Thanks for the reply. It is really helpful.
However I couldn't figure out why 'History' on the program toolbar is disable for me.
I've the programs (Client.sas and Client_updated.sas) saved in UNIX server under the folder called /data.
03-30-2015 10:27 AM
The compare function within EG works only if you have already used the internal version control system for the SAS code within the project.
In your situation, I would start with using
diff /data/Client.sas /data/Client_updated.sas
from the commandline on the UNIX server and look at the output. It is a bit cryptic, but it provides all the answers. (info diff)
03-30-2015 10:31 AM
Before you can use the program history feature to commit program changes and compare different versions of a program, your programs need to either be embedded in your project or stored in a Git repository. There is information about this in the program history section of the help: I'd recommend the topics entitled "Committing your program changes" and "Understanding embedded programs."
I hope that helps!!
03-30-2015 10:53 AM
On that note, is there any chance a future EG version might allow .sas files that are linked to an EG project (rather than embedded) to use the EG project file local GIT repository (if that is the right language)?
I may be an oddity, but as I've been working more with EG these past couple years, I've become a fan of EG projects, but I store all of my .sas code on the server and have only links from the project file to the .sas files.
I don't know enough about the architecture of EG (or GIT) to know if there is hope that a future iteration of this new version control approach could work with linked .sas code (and perhaps other linked files...).
03-30-2015 03:39 PM
Regarding Quentin's question... external .sas files (referenced in EG projects via file system or UNC paths) can be stored in external Git repositories. In this case, EG's Program History features (commit, view history, compare, revert, etc.) are available and execute against the external Git repository. (Whereas, embedded programs (in EG project) are tracked in the embedded Git repository (also in EG project).)
However, the Program History feature doesn't really support .sas files referenced from the server (Server's Files location). The reason... even if the file was stored in a Git repository on the server, EG would not typically have shell access to the Git repository to issue Git commands. Nor would we want to try to track changes in the "local" Git repo (embedded in the EG project), because it would only track changes to the file made from within that project. So, if you wish to use the Program History feature with externally referenced .sas files, we recommend referencing them from an external (locally cloned) Git repository (accessible to your file system).
03-30-2015 03:01 PM
To compare two programs in EG 7.1, multi-select (Ctrl+Click) the two programs in the Project Tree or Process Flow, then right-click either of the two programs, and select the Compare context menu item.
Note: This comparison feature requires a one-time installation and specification of a 3rd-party file comparison tool (I like WinMerge) in EG's Tools->Options->File Comparison.
The Program History feature provides additional versioning capabilities. For more information on the Program History feature new to EG 7.1, see this paper:
03-31-2015 03:40 AM
I did multi-select (Ctrl+Click) the two programs in the Project Tree and I got the warning as follows as soon I select 'Compare'.
'An custom file comparison tool must be configured to complete this action'.
You did mention about the installation of 3rd party file comparison tool to enable this feature. But I'm not sure to have this done.
03-31-2015 03:53 AM
As Casey already suggested, I also recommend WinMerge. If you don't have admin permissions on your PC, have your admin download and install it.
03-31-2015 04:53 AM
may I request you to tell me, how admin will connect (or set up the interface between EG and WinMerge) WinMerge in SAS EG after the installation of WinMerge?