I believe having a planned ending is good... But then again, it's always best to have the story tell itself.. So it's better to be open to varied ones of the planned one, if that makes sense.
it's different for every author. Some preplan and know what's going on, others have no clue. Some write the last sentence first, some start in the middle.
I have written stories, i know the end, but how i may never know when i start writing...
I usually have a general direction the story is going in but it's also very flexible. Sometimes I have no idea how it's going to end up.
You have a complete story in mind,from the beginning. It may twist and turn but usually ends up where you originally Planed.
I don't know to be honest.
I have heard it said that art is doomed to failure if you know where you are going before you begin.
It's all according to what you're writing. If it's nonfiction, you obviously know the ending, to a degree. If it's fiction, I think it's better to not know the ending until you type it in. That way, it's more fun for you plus more surprising to the reader. :)