- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How to compare two SAS codes in SAS EG 7.1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Could you expand on this a bit? It's not clear what you're trying to do.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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. : )
http://blogs.sas.com/content/sasdummy/2014/10/12/eg-71-new-programmer-features/
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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".
Thanks,
Jennifer
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!!
Thanks,
Jennifer
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jennifer,
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...).
Thanks,
--Q.
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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).
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
http://support.sas.com/resources/papers/proceedings14/SAS179-2014.pdf
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?