07-02-2015 05:22 AM
07-02-2015 05:02 AM
Yes, just datastep load them into datasets, then proc compare:
length buffer $2000;
input buffer $;
proc compare base=base...;
However, more importantly is why you want to do this. Computer comparisons are logical, hence if there is one extra line in at line 2, then everything from that point on will not match.
I would suggest that you are better off using version control software - its useful at any level of programming. This is a database which holds base file and every revision to that file. It can give you XML reports on differences etc. Also has roll-back functionality and never loses history.
07-02-2015 07:49 AM
The reason of comparing program is that I need to migrate some SAS programs from SDD3.5(windows) to SDD4.5(unix). And due to this I have to make same changes in the program like changes backward slash ('\') to forward slash ('/'). After making changes I need to make sure that anything else is not changed accidently.
07-02-2015 08:33 AM
Well, you can use the compare above, but your better off using a text compare such as diff which KurtBremser has provided. You can then use that output as part of the documentation of the migration program.
07-02-2015 05:22 AM
07-02-2015 03:13 PM
Also useful is the freely available tkdiff that gives a visual, side by side comparison of programs (Unix). On a Windows platform, the PSP editor has a very similar text difference tool that does a side by side comparison.
07-02-2015 05:25 PM
The idea of comparing two SAS programs as-is could be flawed, depending on the SAS environment where invoked, and also considering if/how SAS AUTOCALL MACROs or MACRO statements (old SAS 79 style - ex: MACRO _BOO BLAH BLAH BLAH % ) may be exploited (that being embedded code references where you would only see %xxxxxxx; (disclaimer-invoked: oversimplified example) in the main SAS code-piece being analyzed.
Also depending on the SAS process / code complexity, there may be path-conditions influencing just how much of the code is executed, such as a passed SYSPARM or incoming %LET macro variables.
Need further help from the community? Please ask a new question.