BookmarkSubscribeRSS Feed
ZRick
Obsidian | Level 7

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?

3 REPLIES 3
SandyH
Calcite | Level 5

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;

Sudhakar_A
Calcite | Level 5

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

Ron_MacroMaven
Lapis Lazuli | Level 10

This page has programs which return lists of various items

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

Ron Fehd  lists maven

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2436 views
  • 0 likes
  • 4 in conversation