The paper is divided in two parts. In the first one, we consider a linear elliptic partial differential equation, or system, in an unbounded cylinder with a nonpositive term of zero order. We analyze the existence and the dimension of the space of solutions, when we look for solutions which tend exponentially to zero at infinity and for oscillatory solutions which have a potential growth at infinity. This type of problems appears when we study the influence of boundary conditions in homogenization, singular perturbation problems and reduction of dimension problems. As an example, we obtain a corrector result for a wave problem in a thin beam imposing initial and boundary conditions. It was known that the initial conditions produce almost periodic oscillations in time. Here, we show that the boundary conditions also produce almost periodic oscillations in the direction of the axis of the beam.