select
	nvl(a.cuhcls,'0') as cuhcls,
	decode(nvl(a.cuhcls,'0'),'0',nvl(c.snum1,99),nvl(b.snum1,99)) maxvlin,
	cutax,
	cutaxc
from afm90 c,afm90 b,afm03 a
where a.cucd=:cucd
and b.cls(+)='9' and a.cudenp1=b.scls1(+) /* EOS */
and c.cls(+)='9' and a.cudenp2=c.scls1(+) /* FAX */
