The EGR valve on a 1998 Dodge Ram 5.2L V8 is located on the intake manifold, typically towards the
rear (firewall side) of the engine. It's often near the back of the intake manifold, sometimes somewhat hidden. You'll likely need to look carefully around that area to find it. It's a relatively small, cylindrical component with vacuum lines connected to it.
Because of the location and potential for obstructions, a picture from a repair manual or online search specifically showing the 5.2L intake manifold for that year is highly recommended before attempting to locate it. A visual guide will greatly increase the chances of finding it quickly and accurately.