We consider two different problems involving the localization of a single p
olymer chain: (i) a periodic AB copolymer at a selective fluid-fluid interf
ace, 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 tra
nsition in a grand canonical approach. We recover the results obtained in p
revious studies via transfer matrix methods. Moreover, we calculate in this
way the loop length distribution functions in the localized phase. Some fi
nite size effects are also determined and tested numerically.