no cherokee 4.0l fans are out to the side whereas grand cherokee fans are in center of engine . not saying you cannot swap things around but also grand cherokee 4.0l have crank angle sensors whereas cherokees dont. from my understanding.
i thought the computers and ignition systems changed in '99? if so it would be ALOT of work to make it all mesh together, and not be legal anyway. must use engine of same year or newer
The engine should be the same on the 97/98. Just swap the parts off the old engine onto the new one that are different. I swapped a 95 4.0 into a 97 while back and the distibutor, oil filter housing, intake, valve cover, temp sensor, and oil press switch needed swapped because of the different style. Other than that it fired right up and ran great.