Try this %put Byvar is: &byvar.;
%put Var is: &var.; Check the log. If the value of &byvar. &var. does not contain a comma (,) then modify your script like this proc sql noprint;
create table frq02_01 as select count(distinct usubjid) as count, &byvar., &var., ord2, txt2, ord3, txt3, ord4, txt4
from frq01_01
group by &byvar., &var., ord2, txt2, ord3, txt3, ord4, txt4;
create table frq02_02 as select count(distinct usubjid) as count, &byvar., &var., ord2, txt2, ord3, txt3, ord4, txt4, atoxgr
from frq01_01
group by &byvar., &var., ord2, txt2, ord3, txt3, ord4, txt4, atoxgr;
create table frq02_03 as select count(distinct usubjid) as count, &byvar., &var., ord2, txt2, ord4, txt4
from frq01_01
group by &byvar.,&var., ord2, txt2, ord4, txt4;
create table frq02_04 as select count(distinct usubjid) as count, &byvar., &var., ord2, txt2, ord4, txt4, atoxgr
from frq01_01
group by &byvar., &var., ord2, txt2, ord4, txt4, atoxgr;
quit; Hope this helps.
... View more