Leo Rosten wrote, "The purpose of life is not to be happy --- but to matter, to be productive, to be useful, to have it make some difference that you have lived at all."
It all depends on what you mean by “happy.” The aim of every rational being is to be happy, if you understand the word in the traditional sense of “human flourishing.”
The modern meaning—“to feel good”—is a poor substitute. And if this is Rosten’s objection, I’m with him. Feelings come and go. One day I’m happy, the next I’m frustrated. One day I’m in a good mood, the next I’m in a sour state.
True happiness is a way of being, not a mood state or feeling. Furthermore, human flourishing is social, not private. When happiness is defined as how I feel, it misses the larger point about happiness.
I think Rosten gets his proposition backwards. I say, when you are productive, useful and make a difference that you have lived, then you will know what happiness is. Happiness is derived from the kind of lives we lead.