can somebody help me take a look at the following macro code to see what's wrong with it. i can run the proc tabulate without macro and no error but when i put it to the macro, it give me the syntax error message:
without macro (no error):
proc tabulate data=adr.clientinfo2019 format=8.1;
class age race ;
table age='' all={label="Subtotal"}, race*(n="No." colpctn="col Percent" ) all={label="Total"} / printmiss box="";
format age age2fmt.;
run;
/***has error when i run the following code**/
%macro colT(dset,colvar,var);
proc tabulate data=&dset. format=20.4;
class &colvar &var ;
table &var.="" all={label="Subtotal"}, &colvar*(n="No." colpctn="Col Percent") ;
run;
%mend colT;
%colT (data, racee age) ;
error message:
NOTE: Line generated by the invoked macro "COLT".
1 proc tabulate data=&dset. format=20.4; class &colvar &var ; table &var.=""
-----
180
1 ! all={label="Subtotal"}, &colvar*(n="No." colpctn="Col Percent") ; run;
ERROR 180-322: Statement is not valid or it is used out of proper order.