Hi

Reply
New Contributor
Posts: 2

Hi

Hi,

I have a Question any one can help me please

I have two libraries

       A) OLD       (oracle)

       B) NEW     (other)

In OLD library i have some 20 datasets...

In NEW library also has same amount of datasets...

Now my task is

In NEW library all datasets will update the data everyday....so i need a code should compare with OLD library datasets....

The macro code should test all --------> The dataset is there or not in library, dataset name, veriable names same or any change, char, numaric, length,....and obs should > 0,....then the code will run to other sas file which has in other location....If any of it worng should get a message where the worng!

Thanks,

Reddy

Frequent Contributor
Posts: 129

Re: Hi

Hi Reddy,

An approach to this might be to use the SAS SQL dictionary tables or sashelp views.  to do these comparisons..  You can find several references to these by searching for  " dictionary views site:support.sas.com"  For SAS 9.2, these are documented at http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001385596.htm

You can use proc compare and the dictionary.tables or sashelp.vtable to check most table/dataset info.  Note, you won't be able to directly check obs for database tables.  So you may need to build a macro or call execute data step which you feed a list of datasets/tables from these views.

You can use proc compare and the dictionary.columns or sashelp.vcolumn to compare column attributes by table/dataset.

For the oracle libname, you will need to make sure tables/views you are using are visible through the libname statment.  You may need 'show-synonyms=yes' if you are accessing synonyms/

Happy coding.

Larry

New Contributor
Posts: 2

Re: Hi

Thanks Larry.

But here we need to use only macro code no other PROC's

Regards,

Reddy

Frequent Contributor
Posts: 129

Re: Hi

Reddy,

Regardless of how you implement the comparisons, these views/tables give you access into metadata about the tables.    You can implement the harvesting of this information into macro variables by using either data step or proc sql code to move the data into macro variables for use by your macros.

Larry

Ask a Question
Discussion stats
  • 3 replies
  • 253 views
  • 4 likes
  • 2 in conversation