Search code examples
saschecksumsas-macro

SAS Compare Two Text Files (Unix / Windows)


I need to compare two text files (in different directories) to see if they are different (a binary result is fine). Given a dataset such as the one below, is this possible within a datastep?

Pathname
c:\one\text1.txt
c:\two\text1.txt
c:\one\text2.txt
c:\two\text2.txt

Alternatively, macro code would be fine! Checksum is a possibility, I need the code to run in both windows & unix.


Solution

  • Pass it to the command line (via a pipe fileref)

    In Windows, use the 'comp' command.

    In Unix, use the 'diff' command.