/* * testmkvarlist2.sas Daniel Brockman 070724 ;*/ /* * doesn't work yet at 070723 */ *-------------------------------------------------------; %let dir=C:\b\SAS-X405.5 ; * root directory ; %let prg=&dir\prg ; * program subdirectory ; %let dat=&dir\data ; * data subdirectory ; %let sub=&dir\sub; * subdir containing autoloaded macros ; libname corral "&dat" ; options ls = 80 mprint mlogic symbolgen sasautos="&sub" spool ; * macros not in autocall library and macros in test ; * tested * %include "&sub\cvtymdsas.sas" ; *%include "&sub\annvol.sas" ; *%include "&sub\cchg.sas" ; * %include "&sub\getdsname.sas" ; %include "&sub\mkvarlist2.sas" ; *-----------------------------; %macro testmule(lib) ; %global greturn ; * we use these to pick up the list & num of vars ; %global greturn1; %let setlist=bpset1 bpsetdtkg ytdsales ; * list of data sets ; %let ii=1; * iterator ; %do %while (%scan(&setlist,&ii," " ) ne) ; * loop data set names ; %let dsn=%scan(&setlist,&ii," "); * get data set name ; %put dsn:&dsn ii:&ii setlist:&setlist ; * test ; %let ii=%eval(&ii+1); proc contents data=&lib..&dsn ; * write the list of vars ; title "Compare list of variables with column heads shown by proc print" ; run; %mkvarlist2(&lib..&dsn); * get list of vars ; %let varlist=&greturn ; * the list ; %let varn=&greturn1 ; * the number ; %put L54 ii:&ii varlist:&varlist varn:&varn ; * test ; data shortset ; set &lib..&dsn ; if ( _N_ < 3 ); run; proc print data=shortset; title "Compare column heads with list of variables from proc contents" ; var %do K=1 %to &varn; %scan(&varlist,&K," ") %end ; ; * end var statement ; run; %put L69 ii:&ii K:&K ; * test; %end ; * do while ; %mend testmule ; *---------------------------------; * run em ; %testmule(corral);