To define new variables you need to know how many to create BEFORE that data step even starts running so there is no way the syntax you proposed could work (even if SAS modified the language to allow it).
You might try this method to create a macro variable first and then use that in the data step.
data _null_;
if 0 set have ;
array cats category: ;
call symputx('nvars',dim(cats));
stop;
run;
data want;
set have ;
array cats category: ;
array price [&nvars] ;
...