BookmarkSubscribeRSS Feed
Helannivas
Quartz | Level 8

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.

 

 

3 REPLIES 3
Kurt_Bremser
Super User

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.

ChrisBrooks
Ammonite | Level 13

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...

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.  

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1041 views
  • 0 likes
  • 4 in conversation