It looks like the problem is most likely because SAS thinks &var_median is a macro variable (as in %let var_median=Variable; ). You need a period at the end of your macro variable so that SAS will look up the correct macro variable name. It also looks like the && is redundant in your code.
Does the variable in tmp1 must be xmedian? Can it be medianx?
If medianx is ok, try the following code:
proc means maxdec=2 data=&data noprint;
output out=tmp1 median(&var)=median&var;
set tmp1(where=(_Type_ NE 0));
drop _Type_ _Freq_;