DATA Step, Macro, Functions and more

any macros to list two folder's data file list and compare their contents?

Reply
Frequent Contributor
Posts: 133

any macros to list two folder's data file list and compare their contents?

I have a production environment and dev environment, folder structure are almost identical.

I need to constantly compare the data in the development folder vs in the production folder.

For example, I have dev folder, /dev, production folder /prod, both have at least dozen files.

how do I do a proc compare on those two folders without manually input what data file is compared with what data file?

I have the proc compare macro, but I don't know how to dynamically generate a two columns of tables and read it using the loop to do the macro.

any test code/suggestions?

Occasional Contributor
Posts: 8

Re: any macros to list two folder's data file list and compare their contents?

libname folder1 '...'

libname folder2 '...'

proc sql;

     create table t1 as

    select memname

   from dictionary.tables

   where upcase(libname)=folder1

   create table t2 as

   ...(the same here)

quit;

proc compare t1 vs t2;

Contributor
Posts: 60

Re: any macros to list two folder's data file list and compare their contents?

Hi,

just a clarification about your question. Do you need to compare the filenames between two folders? or to compare the datasets in both the folders ?

Sudhakar

Regular Contributor
Posts: 227

Re: any macros to list two folder's data file list and compare their contents?

This page has programs which return lists of various items

http://www.sascommunity.org/wiki/Making_Lists

Ron Fehd  lists maven

Ask a Question
Discussion stats
  • 3 replies
  • 995 views
  • 0 likes
  • 4 in conversation