Hi,
Usually we will develop our SAS DI Job in Development Envrionment and then we will move to UAT and Prod Envrionment.
But during testing, we will change the code in UAT and sometime in Dev and then we will migrate to Prod.
Now all the Environments are not in Sync. I have a requirement to compare the codes available in all the Environments.
Usually the codes are having more than 1000 lines and Its really tough to compare the codes manually.
Is there any possible ways to compare the codes automaically?? Please advise.
Thanks in Advance.
If your server runs on a real operating system (UNIX), you can use the diff command to compare text files. The output from that can be used with the patch command to bring files up-to-date.
You should consider using a Source Control product such as Git - used properly it will eliminate these problems and give you a reliable back up in case of disaster. It's also free if you if you install it on your local server...
If used on an Unreal operating system (unlike @Kurt_Bremser 🐵 there are numerous options for text comparisons. For instance, on windows you have the fc tool from the command line which can compare files, so you could stream that into a SAS program. I would be careful that the files are very similar though, adding a return after the first line of 2000 lines, would result in 1999 differences for instance, so you may need to process the compare information, or even write a SAS program to load the two files, strip blanks/returns other specials out of the files, then compare the remaining characters - this is something we do on RTF files for instance.
I would agree with @ChrisBrooks that a version control system is your best bet for consistency across various areas/systems, that will retain one repository version, and the others extract a local copy maintaing the link between the two.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.