idles up and down, even worse when driving on 2002 Dodge Dakota

The rpm guage goes up and down, while sitting still and while driving down the road. And sometimes acts like it doesn't want to shift from one gear to the next. the code on diagnostic i think was EVA.

Asked by for the 2002 Dodge Dakota
I'm not familiar with that kind of surging while driving. While idling - sounds like a vacuum leak, and air intake leak, a sticking idle control valve, an EGR valve or system restriction.

As far as the shifting - poor engine performance can influence shift patterns - so I'm not too sure it's a transmission problem first thing.
thank yoy