|
On Fri, 8 Feb 2008 16:17:32 -0500, Kevin F. Spratt
<Kevin.F.Spratt@DARTMOUTH.EDU> wrote:
>I have written a program that uses proc compare to look for
>differences in data entry.
...
>My problem is that I need to do this for 14 separate tables and I will
>need to do this regularly as these tables continue their growth.
>
>My "plan" is to create a separate SAS data set that includes the
>Access table names and several of the variable names from each table
>that are needed for the proc compare program I have created to work.
>My hope is that I can create a macro that will loop through this SAS table
>one record at a time where each record provides the keywords needed to
>create the appropriate BASE and COMPARE data sets for each table.
>
>I have written the macro that does the work, for any given table when
>I input the correct keywords, but I can't figure out how to inform the
>macro based on the SAS data set I have created that summarizes the table
>and I'm not sure about how to loop through through the tables.
...
hi, kevin,
Use the execute() call routine. hth.
cheers,
chang
p.s. proc compare is that good, huh?!
/* your macro. here we assume a dummy. */
%macro comp(base=, comp=);
%put base=&base. comp=&comp.;
%mend comp;
/* dataset with parameters */
data tables;
length base compare $32.;
input base $ compare $;
cards;
tbl_oneB tbl_oneC
tbl_twoB tbl_twoC
;
run;
/* call macro %comp dynamically */
data _null_;
set tables;
call execute(cat('%comp(base=',base,',comp=',compare,')'));
run;
/* on log
base=tbl_oneB comp=tbl_oneC
base=tbl_twoB comp=tbl_twoC
*/
|