I have been using SAS EG program history for embedded programs for a while now. Usually it works as expected--when I add code to an existing program that has already been committed, the new code is highlighted green and the previous code is not highlighted (see screenshot below):
Instead of just highlighting changes, sometimes it shows a replacement of the entire program--all of the previous is highlighted red, and then the same code plus the new code is highlighted green, as if the program has been replaced entirely. Below is a screenshot of the same addition showing up as replacement of entire file (the top half of this commit shows all the previous code highlighted red):
Has anyone else had this issue, and have you found a way to make sure that only the new changes are highlighted? Thanks in advance for any help you can offer!
Assuming it is not a bug in EG then I suspect in those cases there are white space differences between the two versions. Perhaps one version had trailing spaces removed. Perhaps one version used CR+LF and the other just used LF as the end of line marker.
I have not used this EG feature, but based on other difference displays I have used check if EG has an option to ignore white space differences.
Thanks for the reply! In the example I posted, the only thing changed in the code was a copy/paste of the additional code, so there wouldn't have been any other changes to trailing spaces (if any) or end of line characters on the other lines.
One other thing I've noticed when I click on commit is that some of the programs on all process flows show up as being completely replaced (everything highlighted red and then the same code in green) even though I have not made any changes to those programs. When I open those programs and click commit, sometimes the changes show up but sometimes SAS indicates there is no change to commit.
Copy and paste from where?
One annoying thing that SAS introduced with the "Enhanced" editor is that it preserves trailing spaces on the ends of lines. The old editor they had in Display Manager was better suited for code editing.
PS Don't place physical tab characters inside of program files. The bytes saved are not worth it. And ironically they make aligning the text harder. It you do want to include them then make sure they only appear at the beginning of the lines.
This project will be a demo of version control/program history, and I'm using another SAS EG project as the source of the code and changes. The files in the demo project were copied and pasted from the original project. The changes were copied and pasted from that project or from the demo project (I've recreated this program several times in attempting to figure out what's going on). Notepad++ file compare shows no differences between the two versions, and both have <CR><LF> line endings.
Thanks for the tip about tabs! Do you think replacing them with spaces works better?
Hi,
The "white space" highlighted by @Tom could be down to editor settings which optionally allow the tab character to be replaced by space characters. So if another developer uses the tab character and your editor settings replace them with spaces, then this could be the source of the highlighted differences. You can check & compare your editor settings to see if it is the root cause.
Thanks & kind regards,
Amir.
Thanks, Amir! I am the only developer working on this project; it is supposed to be a source-control demo for other SAS developers at my company. I tried starting the project again and removed and then replaced the indentations to make sure they were tabs and not spaces; this did not help.
See if it is possible to save the two version as separate files and compare them using some other tool to see if in fact there are differences in those lines.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.