Hello,
I'm trying to use the row totals within groups for the percentages in proc gchart. I did find this bit of code that works spectacularly:
proc freq data=&dsn;
table q4*q606 /out=gd outpct noprint;
run;
proc gchart data=gd;
vbar q4 / patternID=group group=q606
freq=pct_row
discrete noframe
outside=freq inside=count
width=&width gspace=&gspace
raxis=axis1 maxis=axis2 gaxis=axis3
legend;
where q4 ne . and q606 ne .;
run; quit;
However, given that I have a lot of variables to go through like this, I wrote the following macro and though I understand why I'm getting the error that _all_ doesn't exist in the gd dataset, I'm not sure how to go about resolving that.
%macro graphsnum(dsn,dsn3,var,covar);
proc freq data=&dsn;
table &var*&covar/ out=&dsn3 outpct noprint;
run;
proc gchart data=&dsn3;
vbar &var / patternID=group group=&covar
freq=pct_row outside=FREQ
discrete noframe width=&width gspace=&gspace
raxis=axis1 maxis=axis2 gaxis=axis3
legend;
where &var ne . and &covar ne . and &covar ne 3;
run; quit;
%mend graphsnum;
%graphsnum(&dsn,&dsn3,_all_,gender);
Any sort of insight would be appreciated!