If you're looking for a solution where the value of $x$ doesn't involve $a$, you can solve for $a$ and $x$ in terms of $b$ and $y$:
solve(..., [a,x]);
$$[[a = y-b, x = 2 y]]$$
and then rewrite the first equation to give $y$ in terms of $a$ and $b$:
isolate(%[1][1],y);
[completely revised: hopefully with better understanding of the question, on account of ensuing comments]
G := proc(P,e,vlist::list(name)) local g, res;
if e=1 then res:=p
else
g:=freeze(e);
res:=coeff(subs(e=g,P),g);
end if;
eval(res,[seq(v=0,v in vlist)]);
end proc:
p := 7*x^2*y*z^2 + 2*x*y^2 + 3*x^2*y + 17*x*y + 8*x^3*y - 33:
G(p, x, [x,y,z]);
0
G(p, y*x^2, [x,y,z]);
3
G(p, y^2*x, [x,y,z]);
2
G(p, y*x, [x,y,z]);
17
G(p, y^2*x^2, [x,y,z]);
0
G(p, z^2*x^2*y, [x,y,z]);
7
G(p, 1, [x,y,z]);
-33
Best Answer
The desire function is the last output as you see. Thanks.