  We consider two different problems involving the localization of a single
polymer chain: (i) a periodic $AB$ copolymer at a selective fluid-fluid
interface, with the upper (resp. lower) fluid attracting $A$ (resp. $B$)
monomers (ii) a homopolymer chain attracted to a hard wall (wetting). Self
avoidance is neglected in both models, which enables us to study their
localization transition in a grand canonical approach. We recover the results
obtained in previous studies via transfer matrix methods. Moreover, we
calculate in this way the loop length distribution functions in the localized
phase. Some finite size effects are also determined and tested numerically.
